Skip to content

Commit

Permalink
Avoid SyntaxError on Python 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
caruccio committed Mar 7, 2012
1 parent 681905c commit 0e76966
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pycassa/types.py
Expand Up @@ -117,8 +117,13 @@ class DateType(CassandraType):

def _to_timestamp(v, use_micros=False):
# Expects Value to be either date or datetime
scale = 1e6 if use_micros else 1e3
micro_scale = 1.0 if use_micros else 1e3
if use_micros:
scale = 1e6
micro_scale = 1.0
else:
scale = 1e3
micro_scale = 1e3

try:
converted = time.mktime(v.timetuple())
converted = (converted * scale) + \
Expand Down

0 comments on commit 0e76966

Please sign in to comment.