summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-03-04 22:25:21 (GMT)
committerGuido van Rossum <guido@python.org>1995-03-04 22:25:21 (GMT)
commit7b5430f2e82a6fca7d77bb5b4a4d9e588dc3ad05 (patch)
tree8b930011591e780af468acc2ce5919fb4680386e /Lib/pickle.py
parentcd259d0b401f8cdd859bd55167610230d9a44f5d (diff)
downloadcpython-7b5430f2e82a6fca7d77bb5b4a4d9e588dc3ad05.zip
cpython-7b5430f2e82a6fca7d77bb5b4a4d9e588dc3ad05.tar.gz
cpython-7b5430f2e82a6fca7d77bb5b4a4d9e588dc3ad05.tar.bz2
raise EOFError when load() hits EOF, instead of KeyError
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 484f468..7984b98 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -356,6 +356,10 @@ class Unpickler:
dispatch = {}
+ def load_eof(self):
+ raise EOFError
+ dispatch[''] = load_eof
+
def load_persid(self):
pid = self.readline()[:-1]
self.stack.append(self.persisent_load(pid))