diff options
author | Danny Hermes <daniel.j.hermes@gmail.com> | 2016-04-07 12:10:27 -0700 |
---|---|---|
committer | Danny Hermes <daniel.j.hermes@gmail.com> | 2016-04-07 12:10:27 -0700 |
commit | 7408a645fe930a10bf559fdb346df6352ebd3d35 (patch) | |
tree | 0d6a9a52fecdbd4bfc15148648d166ac924724a8 /oauth2client | |
parent | ef33f70abb43da50793f169ad7efdd4c72df4966 (diff) | |
download | oauth2client-7408a645fe930a10bf559fdb346df6352ebd3d35.tar.gz |
Replacing now() with utcnow() in device info code.
Diffstat (limited to 'oauth2client')
-rw-r--r-- | oauth2client/client.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/oauth2client/client.py b/oauth2client/client.py index 3c958d2..c3fb379 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): @@ -1863,7 +1862,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) |