From: Victor Stinner Date: Tue, 19 Jan 2016 07:48:48 +0000 (+0100) Subject: Fix BytecodeTestCase.assertNotInBytecode() X-Git-Tag: v3.6.0a1~739^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47b91b0a8112983e8aec5c26497b10aad7045a76;p=thirdparty%2FPython%2Fcpython.git Fix BytecodeTestCase.assertNotInBytecode() Issue #11816: Fix bytecode_helper to handle correctly errors. Don't use unassigned variables. --- diff --git a/Lib/test/bytecode_helper.py b/Lib/test/bytecode_helper.py index 58b4209f5543..347d60337d76 100644 --- a/Lib/test/bytecode_helper.py +++ b/Lib/test/bytecode_helper.py @@ -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'