We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4541476 commit 1d905d5Copy full SHA for 1d905d5
telegram/utils/request.py
@@ -28,6 +28,7 @@
28
29
import certifi
30
import urllib3
31
+import urllib3.contrib.appengine
32
from urllib3.connection import HTTPConnection
33
from urllib3.util.timeout import Timeout
34
try:
@@ -93,7 +94,11 @@ def __init__(self,
93
94
proxy_url = os.environ.get('HTTPS_PROXY') or os.environ.get('https_proxy')
95
96
if not proxy_url:
- mgr = urllib3.PoolManager(**kwargs)
97
+ if urllib3.contrib.appengine.is_appengine_sandbox():
98
+ # Use URLFetch service if running in App Engine
99
+ mgr = urllib3.contrib.appengine.AppEngineManager()
100
+ else:
101
+ mgr = urllib3.PoolManager(**kwargs)
102
else:
103
kwargs.update(urllib3_proxy_kwargs)
104
if proxy_url.startswith('socks'):
0 commit comments