Skip to content

Commit

Permalink
Check for utctimetuple attr instead of timetuple
Browse files Browse the repository at this point in the history
  • Loading branch information
thobbs committed May 29, 2012
1 parent 91a5887 commit 373f262
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pycassa/util.py
Expand Up @@ -7,7 +7,6 @@
import random
import uuid
import calendar
import datetime

__all__ = ['convert_time_to_uuid', 'convert_uuid_to_time', 'OrderedDict']

Expand Down Expand Up @@ -66,7 +65,7 @@ def convert_time_to_uuid(time_arg, lowest_val=True, randomize=False):
if isinstance(time_arg, uuid.UUID):
return time_arg

if hasattr(time_arg, 'timetuple'):
if hasattr(time_arg, 'utctimetuple'):
seconds = int(calendar.timegm(time_arg.utctimetuple()))
microseconds = (seconds * 1e6) + time_arg.time().microsecond
elif type(time_arg) in _number_types:
Expand Down

0 comments on commit 373f262

Please sign in to comment.