mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-123309: Remove check for redefined memo entry in pickletools.dis() (GH-123374)
Such pickles are supported by the Unpickler even if the Pickler does not produce them.
This commit is contained in:
parent
fc897fcc01
commit
5414b97ce2
3 changed files with 11 additions and 24 deletions
|
@ -206,7 +206,7 @@ highest protocol among opcodes = 0
|
|||
def test_no_mark(self):
|
||||
self.check_dis_error(b'Nt.', '''\
|
||||
0: N NONE
|
||||
1: t TUPLE no MARK exists on stack
|
||||
1: t TUPLE
|
||||
''', 'no MARK exists on stack')
|
||||
|
||||
def test_put(self):
|
||||
|
@ -221,26 +221,16 @@ highest protocol among opcodes = 4
|
|||
''')
|
||||
|
||||
def test_put_redefined(self):
|
||||
self.check_dis_error(b'Np1\np1\n.', '''\
|
||||
self.check_dis(b'Np1\np1\nq\x01r\x01\x00\x00\x00\x94.', '''\
|
||||
0: N NONE
|
||||
1: p PUT 1
|
||||
4: p PUT 1
|
||||
''', 'memo key 1 already defined')
|
||||
self.check_dis_error(b'Np1\nq\x01.', '''\
|
||||
0: N NONE
|
||||
1: p PUT 1
|
||||
4: q BINPUT 1
|
||||
''', 'memo key 1 already defined')
|
||||
self.check_dis_error(b'Np1\nr\x01\x00\x00\x00.', '''\
|
||||
0: N NONE
|
||||
1: p PUT 1
|
||||
4: r LONG_BINPUT 1
|
||||
''', 'memo key 1 already defined')
|
||||
self.check_dis_error(b'Np1\n\x94.', '''\
|
||||
0: N NONE
|
||||
1: p PUT 1
|
||||
4: \\x94 MEMOIZE (as 1)
|
||||
''', 'memo key None already defined')
|
||||
7: q BINPUT 1
|
||||
9: r LONG_BINPUT 1
|
||||
14: \\x94 MEMOIZE (as 1)
|
||||
15: . STOP
|
||||
highest protocol among opcodes = 4
|
||||
''')
|
||||
|
||||
def test_put_empty_stack(self):
|
||||
self.check_dis_error(b'p0\n', '''\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue