Skip to content

Commit e0c51b9

Browse files
author
Orest Bolohan
committed
Applied some of Craig's suggestions.
1 parent dff7414 commit e0c51b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

oauth2client/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,14 +629,16 @@ def set_store(self, store):
629629
self.store = store
630630

631631
def _expires_in(self):
632-
"""Get in how many seconds does the token expire."""
632+
"""Return the number of seconds until this token expires."""
633633
if self.token_expiry:
634634
now = datetime.datetime.utcnow()
635635
if self.token_expiry > now:
636636
time_delta = self.token_expiry - now
637637
return int(round(time_delta.days * 86400.0 +
638638
time_delta.seconds +
639639
time_delta.microseconds * 0.000001))
640+
else:
641+
return 0
640642

641643
def _updateFromCredential(self, other):
642644
"""Update this Credential from another instance."""

0 commit comments

Comments
 (0)