Message349193
I want to believe there is a mistake in the doc strings for these methods:
def assertInBytecode(self, x, opname, argval=_UNSPECIFIED):
"""Returns instr if op is found, otherwise throws AssertionError"""
for instr in dis.get_instructions(x):
if instr.opname == opname:
if argval is _UNSPECIFIED or instr.argval == argval:
return instr
disassembly = self.get_disassembly_as_string(x)
if argval is _UNSPECIFIED:
msg = '%s not found in bytecode:\n%s' % (opname, disassembly)
else:
msg = '(%s,%r) not found in bytecode:\n%s'
msg = msg % (opname, argval, disassembly)
self.fail(msg)
def assertNotInBytecode(self, x, opname, argval=_UNSPECIFIED):
"""Throws AssertionError if op is found"""
for instr in dis.get_instructions(x):
if instr.opname == opname:
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'
msg = msg % (opname, argval, disassembly)
self.fail(msg)
It is supported to refer to *opname* not *op*. Either the method signatures or the doc strings have to be updated. I stand to be corrected If wrong though. |
|
Date |
User |
Action |
Args |
2019-08-07 19:22:07 | nanjekyejoannah | set | recipients:
+ nanjekyejoannah |
2019-08-07 19:22:07 | nanjekyejoannah | set | messageid: <1565205727.21.0.329229994167.issue37789@roundup.psfhosted.org> |
2019-08-07 19:22:07 | nanjekyejoannah | link | issue37789 messages |
2019-08-07 19:22:07 | nanjekyejoannah | create | |
|