summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_datetime.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_datetime.py')
-rw-r--r--Lib/test/test_datetime.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py
index 203bea1..4f765c1 100644
--- a/Lib/test/test_datetime.py
+++ b/Lib/test/test_datetime.py
@@ -5,8 +5,11 @@ See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
import sys
import pickle
-import cPickle
import unittest
+try:
+ import cPickle
+except ImportError:
+ cPickle = None
from test import test_support
@@ -18,9 +21,14 @@ from datetime import date, datetime
pickle_choices = [(pickler, unpickler, proto)
for pickler in pickle, cPickle
+ if pickler is not None
for unpickler in pickle, cPickle
+ if unpickler is not None
for proto in range(3)]
-assert len(pickle_choices) == 2*2*3
+if cPickle is None:
+ assert len(pickle_choices) == 3
+else:
+ assert len(pickle_choices) == 2*2*3
# An arbitrary collection of objects of non-datetime types, for testing
# mixed-type comparisons.