mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix BytecodeTestCase.assertNotInBytecode()
Issue #11816: Fix bytecode_helper to handle correctly errors. Don't use unassigned variables.
This commit is contained in:
parent
9ad11544bf
commit
47b91b0a81
1 changed files with 2 additions and 2 deletions
|
@ -32,8 +32,8 @@ class BytecodeTestCase(unittest.TestCase):
|
|||
"""Throws AssertionError if op is found"""
|
||||
for instr in dis.get_instructions(x):
|
||||
if instr.opname == opname:
|
||||
disassembly = self.get_disassembly_as_string(co)
|
||||
if opargval is _UNSPECIFIED:
|
||||
disassembly = self.get_disassembly_as_string(x)
|
||||
if argval is _UNSPECIFIED:
|
||||
msg = '%s occurs in bytecode:\n%s' % (opname, disassembly)
|
||||
elif instr.argval == argval:
|
||||
msg = '(%s,%r) occurs in bytecode:\n%s'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue