Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47b91b0

Browse files
committed
Fix BytecodeTestCase.assertNotInBytecode()
Issue #11816: Fix bytecode_helper to handle correctly errors. Don't use unassigned variables.
1 parent 9ad1154 commit 47b91b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/bytecode_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def assertNotInBytecode(self, x, opname, argval=_UNSPECIFIED):
3232
"""Throws AssertionError if op is found"""
3333
for instr in dis.get_instructions(x):
3434
if instr.opname == opname:
35-
disassembly = self.get_disassembly_as_string(co)
36-
if opargval is _UNSPECIFIED:
35+
disassembly = self.get_disassembly_as_string(x)
36+
if argval is _UNSPECIFIED:
3737
msg = '%s occurs in bytecode:\n%s' % (opname, disassembly)
3838
elif instr.argval == argval:
3939
msg = '(%s,%r) occurs in bytecode:\n%s'

0 commit comments

Comments
 (0)