Skip to content

Commit

Permalink
cast time to int before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
bdauvergne committed Oct 4, 2012
1 parent 265a145 commit 26df82e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oath/totp.py
Expand Up @@ -49,7 +49,7 @@ def totp(key, format='dec6', period=30, t=None, hash=hashlib.sha1):
:type: str
'''
if t is None:
t = time.time()
t = int(time.time())
else:
if isinstance(t, datetime.datetime):
t = calendar.timegm(t.utctimetuple())
Expand Down

0 comments on commit 26df82e

Please sign in to comment.