File tree Expand file tree Collapse file tree 2 files changed +14
-17
lines changed
Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 66
77
88def is_appengine ():
9- return is_local_appengine () or is_prod_appengine () or is_prod_appengine_mvms ()
9+ return "APPENGINE_RUNTIME" in os . environ
1010
1111
1212def is_appengine_sandbox ():
13- return is_appengine () and not is_prod_appengine_mvms ()
13+ """Reports if the app is running in the first generation sandbox.
14+
15+ The second generation runtimes are technically still in a sandbox, but it
16+ is much less restrictive, so generally you shouldn't need to check for it.
17+ see https://cloud.google.com/appengine/docs/standard/runtimes
18+ """
19+ return is_appengine () and os .environ ["APPENGINE_RUNTIME" ] == "python27"
1420
1521
1622def is_local_appengine ():
17- return (
18- "APPENGINE_RUNTIME" in os .environ
19- and "Development/" in os .environ ["SERVER_SOFTWARE" ]
23+ return is_appengine () and os .environ .get ("SERVER_SOFTWARE" , "" ).startswith (
24+ "Development/"
2025 )
2126
2227
2328def is_prod_appengine ():
24- return (
25- "APPENGINE_RUNTIME" in os .environ
26- and "Google App Engine/" in os .environ ["SERVER_SOFTWARE" ]
27- and not is_prod_appengine_mvms ()
29+ return is_appengine () and os .environ .get ("SERVER_SOFTWARE" , "" ).startswith (
30+ "Google App Engine/"
2831 )
2932
3033
3134def is_prod_appengine_mvms ():
32- return os .environ .get ("GAE_VM" , False ) == "true"
35+ """Deprecated."""
36+ return False
Original file line number Diff line number Diff line change @@ -108,13 +108,6 @@ def __init__(
108108 "URLFetch is not available in this environment."
109109 )
110110
111- if is_prod_appengine_mvms ():
112- raise AppEnginePlatformError (
113- "Use normal urllib3.PoolManager instead of AppEngineManager"
114- "on Managed VMs, as using URLFetch is not necessary in "
115- "this environment."
116- )
117-
118111 warnings .warn (
119112 "urllib3 is using URLFetch on Google App Engine sandbox instead "
120113 "of sockets. To use sockets directly instead of URLFetch see "
You can’t perform that action at this time.
0 commit comments