mirror of
https://github.com/python/cpython.git
synced 2025-12-08 02:08:20 +00:00
raise EOFError when load() hits EOF, instead of KeyError
This commit is contained in:
parent
cd259d0b40
commit
7b5430f2e8
1 changed files with 4 additions and 0 deletions
|
|
@ -356,6 +356,10 @@ class Unpickler:
|
||||||
|
|
||||||
dispatch = {}
|
dispatch = {}
|
||||||
|
|
||||||
|
def load_eof(self):
|
||||||
|
raise EOFError
|
||||||
|
dispatch[''] = load_eof
|
||||||
|
|
||||||
def load_persid(self):
|
def load_persid(self):
|
||||||
pid = self.readline()[:-1]
|
pid = self.readline()[:-1]
|
||||||
self.stack.append(self.persisent_load(pid))
|
self.stack.append(self.persisent_load(pid))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue