summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-20 00:22:32 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-20 00:22:32 (GMT)
commit99603b0c1edb4b8ca2a30fa90470170b959321ee (patch)
treef0fef33a9c03529354c01f5fd374fd36ebc024d7 /Lib/pickle.py
parentbe6fe5476cc3233ac20e02c0063355a5884663f7 (diff)
downloadcpython-99603b0c1edb4b8ca2a30fa90470170b959321ee.zip
cpython-99603b0c1edb4b8ca2a30fa90470170b959321ee.tar.gz
cpython-99603b0c1edb4b8ca2a30fa90470170b959321ee.tar.bz2
Getting rid of cPickle. Mmm, feels good!
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 9570dd4..6901a64 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -1,6 +1,5 @@
"""Create portable serialized representations of Python objects.
-See module cPickle for a (much) faster implementation.
See module copy_reg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.
@@ -48,8 +47,7 @@ compatible_formats = ["1.0", # Original protocol 0
"2.0", # Protocol 2
] # Old format versions we can read
-# Keep in synch with cPickle. This is the highest protocol number we
-# know how to read.
+# This is the highest protocol number we know how to read.
HIGHEST_PROTOCOL = 2
# The protocol we write by default. May be less than HIGHEST_PROTOCOL.
@@ -591,8 +589,6 @@ class Pickler:
dispatch[list] = save_list
- # Keep in synch with cPickle's BATCHSIZE. Nothing will break if it gets
- # out of synch, though.
_BATCHSIZE = 1000
def _batch_appends(self, items):
@@ -1090,7 +1086,12 @@ class Unpickler:
stack = self.stack
args = stack.pop()
func = stack[-1]
- value = func(*args)
+ try:
+ value = func(*args)
+ except:
+ print(sys.exc_info())
+ print(func, args)
+ raise
stack[-1] = value
dispatch[REDUCE[0]] = load_reduce