summaryrefslogtreecommitdiff
path: root/src/isodate/tests/test_pickle.py
diff options
context:
space:
mode:
authorGerhard Weis <g.weis@griffith.edu.au>2017-07-05 20:54:03 +1000
committerGerhard Weis <g.weis@griffith.edu.au>2017-07-05 20:54:03 +1000
commit0d0abd79a975ed132a8eb43783f87cd84eea9267 (patch)
tree733231867f0ff1ba3679e1d4564a1b2506353cb2 /src/isodate/tests/test_pickle.py
parent1dc3c2481ba32e9dbcad9e55d2c20281f5aa5756 (diff)
parent6e5802bf7b410551f1dfcaf6ede8638f0f233cad (diff)
downloadisodate-0d0abd79a975ed132a8eb43783f87cd84eea9267.tar.gz
Merge branch 'master' of https://github.com/lmazuel/isodate
# Conflicts: # .travis.yml # setup.cfg # src/isodate/tzinfo.py
Diffstat (limited to 'src/isodate/tests/test_pickle.py')
-rw-r--r--src/isodate/tests/test_pickle.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/isodate/tests/test_pickle.py b/src/isodate/tests/test_pickle.py
index 4b824e7..0d8c184 100644
--- a/src/isodate/tests/test_pickle.py
+++ b/src/isodate/tests/test_pickle.py
@@ -1,5 +1,8 @@
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
import unittest
-import cPickle as pickle
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))