diff options
author | Laurent Mazuel <laurent.mazuel@gmail.com> | 2017-06-28 18:28:24 -0700 |
---|---|---|
committer | Laurent Mazuel <laurent.mazuel@gmail.com> | 2017-06-28 18:28:24 -0700 |
commit | ad4e50bd7cdb697606148d434e803fdf7f647f8d (patch) | |
tree | a837912455122800ed51323cc813338d134b7579 /src/isodate/tests/test_pickle.py | |
parent | 3aaf2547850c5e015c88e475364ac77f7fd6a92f (diff) | |
download | isodate-ad4e50bd7cdb697606148d434e803fdf7f647f8d.tar.gz |
Adapt after 2to3 removal
Diffstat (limited to 'src/isodate/tests/test_pickle.py')
-rw-r--r-- | src/isodate/tests/test_pickle.py | 9 |
1 files changed, 6 insertions, 3 deletions
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)) |