Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
Remove usage of os.environ.setdefault.
Browse files Browse the repository at this point in the history
This is somewhat misleading, since it doesn't change the
value of the env. var. in the shell.
  • Loading branch information
dhermes committed Aug 11, 2016
1 parent 5190fd7 commit 7d3cdd8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions oauth2client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,12 @@
DEFAULT_ENV_NAME = 'UNKNOWN'

# If set to True _get_environment avoid GCE check (_detect_gce_environment)
NO_GCE_CHECK = os.environ.setdefault('NO_GCE_CHECK', 'False')
NO_GCE_CHECK = os.getenv('NO_GCE_CHECK', 'False')

# Timeout in seconds to wait for the GCE metadata server when detecting the
# GCE environment.
try:
GCE_METADATA_TIMEOUT = int(
os.environ.setdefault('GCE_METADATA_TIMEOUT', '3'))
GCE_METADATA_TIMEOUT = int(os.getenv('GCE_METADATA_TIMEOUT', 3))
except ValueError: # pragma: NO COVER
GCE_METADATA_TIMEOUT = 3

Expand Down

0 comments on commit 7d3cdd8

Please sign in to comment.