From bf12cdbb2880eb402f65ce8d1db09caa84c6b801 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 17 Aug 2006 20:24:18 +0000 Subject: 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 --- Lib/test/test_re.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_re.py') diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 14a0acfc6b..02f4dcab09 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -412,8 +412,12 @@ class ReTests(unittest.TestCase): def test_pickling(self): import pickle self.pickle_test(pickle) - import cPickle - self.pickle_test(cPickle) + try: + import cPickle + except ImportError: + pass # cPickle not found -- skip it + else: + self.pickle_test(cPickle) def pickle_test(self, pickle): oldpat = re.compile('a(?:b|(c|e){1,2}?|d)+?(.)') -- cgit v1.2.1