summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/test_cpi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/dos-8x3/test_cpi.py')
-rw-r--r--Lib/dos-8x3/test_cpi.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/Lib/dos-8x3/test_cpi.py b/Lib/dos-8x3/test_cpi.py
index 9088eb7..f5e920f 100644
--- a/Lib/dos-8x3/test_cpi.py
+++ b/Lib/dos-8x3/test_cpi.py
@@ -79,18 +79,29 @@ def dotest():
f.close()
try:
cPickle.dump(123, f)
- except IOError:
+ except ValueError:
pass
else:
- print "dump to closed file should raise IOError"
+ print "dump to closed file should raise ValueError"
f = open(fn, "r")
f.close()
try:
cPickle.load(f)
- except IOError:
+ except ValueError:
pass
else:
- print "load from closed file should raise IOError"
+ print "load from closed file should raise ValueError"
os.remove(fn)
+ # Test specific bad cases
+ for i in range(10):
+ try:
+ x = cPickle.loads('garyp')
+ except cPickle.BadPickleGet, y:
+ del y
+ else:
+ print "unexpected success!"
+ break
+
+
dotest()