Skip to content

Commit

Permalink
Fix error in new AppEngine environments
Browse files Browse the repository at this point in the history
Newer AppEngine environments don't define the SERVER_SOFTWARE env variable. Without this change, importing click dies with a KeyError.

See related pull request for urllib3: urllib3/urllib3#1704
  • Loading branch information
aaronsarna authored and jab committed Jan 31, 2020
1 parent 5234cc8 commit 8c5f779
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion click/_compat.py
Expand Up @@ -11,7 +11,7 @@
MSYS2 = sys.platform.startswith('win') and ('GCC' in sys.version)
# Determine local App Engine environment, per Google's own suggestion
APP_ENGINE = ('APPENGINE_RUNTIME' in os.environ and
'Development/' in os.environ['SERVER_SOFTWARE'])
'Development/' in os.environ.get('SERVER_SOFTWARE', ''))
WIN = sys.platform.startswith('win') and not APP_ENGINE and not MSYS2
DEFAULT_COLUMNS = 80

Expand Down

0 comments on commit 8c5f779

Please sign in to comment.