changeset: 99979:bf997b22df06 branch: 3.5 parent: 99975:3c9512d8ac0d user: Victor Stinner date: Tue Jan 19 08:48:48 2016 +0100 files: Lib/test/bytecode_helper.py description: Fix BytecodeTestCase.assertNotInBytecode() Issue #11816: Fix bytecode_helper to handle correctly errors. Don't use unassigned variables. diff -r 3c9512d8ac0d -r bf997b22df06 Lib/test/bytecode_helper.py --- a/Lib/test/bytecode_helper.py Mon Jan 18 21:11:18 2016 -0800 +++ b/Lib/test/bytecode_helper.py Tue Jan 19 08:48:48 2016 +0100 @@ -32,8 +32,8 @@ """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'