aboutsummaryrefslogtreecommitdiff
path: root/oauth2client
diff options
context:
space:
mode:
authorNathaniel Manista <nathaniel@google.com>2016-05-20 08:26:07 -0700
committerNathaniel Manista <nathaniel@google.com>2016-05-20 08:26:07 -0700
commite54e28939cf985e4d25ef34f96162abd3ab65002 (patch)
treee7e2702f2675b485dc82f37d92c8f48fec3ae4c2 /oauth2client
parentf0ba60300c982da0be28ea153f87f1eb574c7e0b (diff)
parent7408a645fe930a10bf559fdb346df6352ebd3d35 (diff)
downloadoauth2client-e54e28939cf985e4d25ef34f96162abd3ab65002.tar.gz
Merge pull request #488 from dhermes/swap-to-utcnow
Replacing now() with utcnow() in device info code.
Diffstat (limited to 'oauth2client')
-rw-r--r--oauth2client/client.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/oauth2client/client.py b/oauth2client/client.py
index 97cc7a3..a3e58ff 100644
--- a/oauth2client/client.py
+++ b/oauth2client/client.py
@@ -120,7 +120,6 @@ _DESIRED_METADATA_FLAVOR = 'Google'
# Expose utcnow() at module level to allow for
# easier testing (by replacing with a stub).
_UTCNOW = datetime.datetime.utcnow
-_NOW = datetime.datetime.now
class SETTINGS(object):
@@ -1879,7 +1878,7 @@ class DeviceFlowInfo(collections.namedtuple('DeviceFlowInfo', (
})
if 'expires_in' in response:
kwargs['user_code_expiry'] = (
- _NOW() +
+ _UTCNOW() +
datetime.timedelta(seconds=int(response['expires_in'])))
return cls(**kwargs)