Path: blob/master/venv/Lib/site-packages/urllib3/contrib/_appengine_environ.py
811 views
"""1This module provides means to detect the App Engine environment.2"""34import os567def is_appengine():8return is_local_appengine() or is_prod_appengine()91011def is_appengine_sandbox():12"""Reports if the app is running in the first generation sandbox.1314The second generation runtimes are technically still in a sandbox, but it15is much less restrictive, so generally you shouldn't need to check for it.16see https://cloud.google.com/appengine/docs/standard/runtimes17"""18return is_appengine() and os.environ["APPENGINE_RUNTIME"] == "python27"192021def is_local_appengine():22return "APPENGINE_RUNTIME" in os.environ and os.environ.get(23"SERVER_SOFTWARE", ""24).startswith("Development/")252627def is_prod_appengine():28return "APPENGINE_RUNTIME" in os.environ and os.environ.get(29"SERVER_SOFTWARE", ""30).startswith("Google App Engine/")313233def is_prod_appengine_mvms():34"""Deprecated."""35return False363738