summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-04-21 20:49:58 (GMT)
committerGuido van Rossum <guido@python.org>2000-04-21 20:49:58 (GMT)
commit84219682fbfb1aff829ed2d3f0bad42c43fc969c (patch)
tree1baf980b12e478869ed18814961a1fafe303ad34
parent83addc7a0f7371ccb28c5fd3b090556b505d8a69 (diff)
downloadcpython-84219682fbfb1aff829ed2d3f0bad42c43fc969c.zip
cpython-84219682fbfb1aff829ed2d3f0bad42c43fc969c.tar.gz
cpython-84219682fbfb1aff829ed2d3f0bad42c43fc969c.tar.bz2
Charles Waldman writes:
""" In the course of debugging this I also saw that cPickle is inconsistent with pickle - if you attempt a pickle.load or pickle.dump on a closed file, you get a ValueError, whereas the corresponding cPickle operations give an IOError. Since cPickle is advertised as being compatible with pickle, I changed these exceptions to match. """
-rw-r--r--Lib/test/test_cpickle.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_cpickle.py b/Lib/test/test_cpickle.py
index 7cc4b1f..f5e920f 100644
--- a/Lib/test/test_cpickle.py
+++ b/Lib/test/test_cpickle.py
@@ -79,18 +79,18 @@ 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