diff options
author | Nathaniel Manista <nathaniel@google.com> | 2016-05-20 08:26:07 -0700 |
---|---|---|
committer | Nathaniel Manista <nathaniel@google.com> | 2016-05-20 08:26:07 -0700 |
commit | e54e28939cf985e4d25ef34f96162abd3ab65002 (patch) | |
tree | e7e2702f2675b485dc82f37d92c8f48fec3ae4c2 /oauth2client | |
parent | f0ba60300c982da0be28ea153f87f1eb574c7e0b (diff) | |
parent | 7408a645fe930a10bf559fdb346df6352ebd3d35 (diff) | |
download | oauth2client-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.py | 3 |
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) |