summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Mazuel <laurent.mazuel@gmail.com>2017-06-29 01:28:24 (GMT)
committerLaurent Mazuel <laurent.mazuel@gmail.com>2017-06-29 01:28:24 (GMT)
commitad4e50bd7cdb697606148d434e803fdf7f647f8d (patch)
treea837912455122800ed51323cc813338d134b7579
parent3aaf2547850c5e015c88e475364ac77f7fd6a92f (diff)
downloadisodate-ad4e50bd7cdb697606148d434e803fdf7f647f8d.tar.gz
Adapt after 2to3 removal
-rw-r--r--src/isodate/isotime.py4
-rw-r--r--src/isodate/tests/test_pickle.py9
2 files changed, 10 insertions, 3 deletions
diff --git a/src/isodate/isotime.py b/src/isodate/isotime.py
index 9650cda..c6d9391 100644
--- a/src/isodate/isotime.py
+++ b/src/isodate/isotime.py
@@ -32,9 +32,13 @@ It supports all basic and extended formats including time zone specifications
as described in the ISO standard.
'''
import re
+import sys
from decimal import Decimal
from datetime import time
+if sys.version_info > (3,):
+ long = int
+
from isodate.isostrf import strftime, TIME_EXT_COMPLETE, TZ_EXT
from isodate.isoerror import ISO8601Error
from isodate.isotzinfo import TZ_REGEX, build_tzinfo
diff --git a/src/isodate/tests/test_pickle.py b/src/isodate/tests/test_pickle.py
index b52f8cb..f4edda6 100644
--- a/src/isodate/tests/test_pickle.py
+++ b/src/isodate/tests/test_pickle.py
@@ -1,5 +1,8 @@
-import unittest
-import cPickle as pickle
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+import unittest
import isodate
@@ -31,7 +34,7 @@ class TestPickle(unittest.TestCase):
pikl = pickle.dumps(dur, proto)
if dur != pickle.loads(pikl):
raise Exception("not equal")
- except Exception, e:
+ except Exception as e:
failed.append("pickle proto %d failed (%s)" % (proto, repr(e)))
self.assertEqual(len(failed), 0, "pickle protos failed: %s" %
str(failed))