From 9b42ffb08076ec52d390bf72cb8e53c3b25596dc Mon Sep 17 00:00:00 2001 From: Zev Goldstein Date: Wed, 27 Nov 2019 15:22:20 -0500 Subject: [PATCH] Revert behavior to is_appengine=False in testbed (#1760) Whether testbed tests "are appengine" is debatable, but historically this function has returned False in testbed tests. This behavior was inadvertently (and unnecessarily) changed in PR #1704. This commit undoes that regression for testbed tests. --- src/urllib3/contrib/_appengine_environ.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/urllib3/contrib/_appengine_environ.py b/src/urllib3/contrib/_appengine_environ.py index 119efaeeb6..8765b907d7 100644 --- a/src/urllib3/contrib/_appengine_environ.py +++ b/src/urllib3/contrib/_appengine_environ.py @@ -6,7 +6,7 @@ def is_appengine(): - return "APPENGINE_RUNTIME" in os.environ + return is_local_appengine() or is_prod_appengine() def is_appengine_sandbox(): @@ -20,15 +20,15 @@ def is_appengine_sandbox(): def is_local_appengine(): - return is_appengine() and os.environ.get("SERVER_SOFTWARE", "").startswith( - "Development/" - ) + return "APPENGINE_RUNTIME" in os.environ and os.environ.get( + "SERVER_SOFTWARE", "" + ).startswith("Development/") def is_prod_appengine(): - return is_appengine() and os.environ.get("SERVER_SOFTWARE", "").startswith( - "Google App Engine/" - ) + return "APPENGINE_RUNTIME" in os.environ and os.environ.get( + "SERVER_SOFTWARE", "" + ).startswith("Google App Engine/") def is_prod_appengine_mvms():