Skip to content

Commit a6b85b4

Browse files
committed
Python 3 preparation: handle absence of "long" type.
Manual patch.
1 parent 794ddb9 commit a6b85b4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

roundup/date.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,13 @@ def __init__(self, spec, sign=1, allowdate=1, add_granularity=False,
737737
):
738738
"""Construct an interval given a specification."""
739739
self.setTranslator(translator)
740-
if isinstance(spec, (int, float, long)):
740+
try:
741+
# Python 2.
742+
arith_types = (int, float, long)
743+
except NameError:
744+
# Python 3.
745+
arith_types = (int, float)
746+
if isinstance(spec, arith_types):
741747
self.from_seconds(spec)
742748
elif isinstance(spec, basestring):
743749
self.set(spec, allowdate=allowdate, add_granularity=add_granularity)

0 commit comments

Comments
 (0)