diff options
author | Guido van Rossum <guido@python.org> | 2006-08-17 20:24:18 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-08-17 20:24:18 (GMT) |
commit | bf12cdbb2880eb402f65ce8d1db09caa84c6b801 (patch) | |
tree | 47ed0e14f7243d2431abe12a352b3cce04a779f5 /Lib/test/pickletester.py | |
parent | 3b271054d7b2300d94f7f1bd3cb48d513d371c70 (diff) | |
download | cpython-bf12cdbb2880eb402f65ce8d1db09caa84c6b801.zip cpython-bf12cdbb2880eb402f65ce8d1db09caa84c6b801.tar.gz cpython-bf12cdbb2880eb402f65ce8d1db09caa84c6b801.tar.bz2 |
Quite a few fixes to make the library and test suite more robust when
cPickle cannot be imported. This was necessary because my last mass
checkin broke cPickle and I don't feel like debugging it right now;
but it seems a good idea in general not to require cPickle when
pickle.py is also there. A few unrelated fixes for issues while
debigging various test failures.
setup.py: disable building of cPickle until I've fixed it
Objects/...
genobject.c: disallow raising string exceptions
Lib/...
Cookie.py: fix doctest not to fail if cPickle is missing
ctypes/macholib/dyld.py: fix relative imports
sqlite3/__init__.py: fix relative import
xml/dom/__init__.py: fix relative import
Lib/test/...
regrtest.py: reduce list of skipped items on darwin
test_generators.py: don't test string exceptions; test throw() errors
test_traceback.py: don't test string exceptions
pickletester.py: don't fail if cPickle is missing
test_datetime.py: don't fail if cPickle is missing
test_descr.py: don't fail if cPickle is missing (still some other failures)
test_exceptions.py: don't fail if cPickle is missing
test_re.py: don't fail if cPickle is missing
test_array.py: use pickle, not cPickle
test_bool.py: don't fail if cPickle is missing
test_deque.py: use pickle, not cPickle
test_logging.py: use pickle, not cPickle
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) |