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
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index be2cca1..0eb6b46 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -4,7 +4,11 @@
import sys
import unittest
import warnings
-import pickle, cPickle
+import pickle
+try:
+ import cPickle
+except ImportError:
+ cPickle = None
from test.test_support import TESTFN, unlink, run_unittest
@@ -292,6 +296,8 @@
# test for pickling support
for p in pickle, cPickle:
+ if p is None:
+ continue # cPickle not found -- skip it
for protocol in range(p.HIGHEST_PROTOCOL + 1):
new = p.loads(p.dumps(e, protocol))
for checkArgName in expected: