diff options
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r-- | Lib/test/pickletester.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 5b9da56..42853c4 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -1,6 +1,9 @@ import unittest import pickle -import cPickle +try: + import cPickle +except ImportError: + cPickle = None import pickletools import copy_reg @@ -10,7 +13,8 @@ from test.test_support import TestFailed, have_unicode, TESTFN, \ # Tests that try a number of pickle protocols should have a # for proto in protocols: # kind of outer loop. -assert pickle.HIGHEST_PROTOCOL == cPickle.HIGHEST_PROTOCOL == 2 +if cPickle is not None: + assert pickle.HIGHEST_PROTOCOL == cPickle.HIGHEST_PROTOCOL == 2 protocols = range(pickle.HIGHEST_PROTOCOL + 1) |