]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
raise EOFError when load() hits EOF, instead of KeyError
authorGuido van Rossum <guido@python.org>
Sat, 4 Mar 1995 22:25:21 +0000 (22:25 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 4 Mar 1995 22:25:21 +0000 (22:25 +0000)
Lib/pickle.py

index 484f4687538a99793b205aa77eb4e3db593d433b..7984b98168bf8ba07e559194bd555fd4b32e3490 100644 (file)
@@ -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))