Skip to content

Commit 9b7ffd7

Browse files
committed
Use better formula to determine local GAE environment
1 parent 10c5e79 commit 9b7ffd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

click/_compat.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
PY2 = sys.version_info[0] == 2
1010
CYGWIN = sys.platform.startswith('cygwin')
11-
APP_ENGINE = os.environ.get('SERVER_SOFTWARE', '').startswith('Development')
11+
# Determine local App Engine environment, per Google's own suggestion
12+
APP_ENGINE = ('APPENGINE_RUNTIME' in os.environ and
13+
'Development/' in os.environ['SERVER_SOFTWARE'])
1214
WIN = sys.platform.startswith('win') and not APP_ENGINE
1315
DEFAULT_COLUMNS = 80
1416

0 commit comments

Comments
 (0)