Commits

Matthew Schinckel  committed eef1084

Removed reliance on numbers.Number, which is newer than python2.5

  • Participants
  • Parent commits 9c44505

Comments (0)

Files changed (1)

File timedelta/helpers.py

 import re
 import datetime
 from decimal import Decimal
-from numbers import Number
 
 def nice_repr(timedelta, display="long"):
     """
     floats/Decimals
     """
     assert isinstance(obj1, datetime.timedelta), "First argument must be a timedelta."
-    assert isinstance(obj2, (datetime.timedelta, Number, Decimal)), "Second argument must be a timedelta or number"
+    assert isinstance(obj2, (datetime.timedelta, int, float, Decimal)), "Second argument must be a timedelta or number"
     
     sec1 = obj1.days * 86400 + obj1.seconds
     if isinstance(obj2, datetime.timedelta):
     """
     
     assert isinstance(obj, datetime.timedelta), "First argument must be a timedelta."
-    assert isinstance(val, (Number, Decimal)), "Second argument must be a number."
+    assert isinstance(val, (int, float, Decimal)), "Second argument must be a number."
     
     sec = obj.days * 86400 + obj.seconds
     sec *= val