pypy/interpreter/astcompiler/test/test_compiler.py::TestCompiler::()::test_load_method_position_multiline::[0]
self = <pypy.interpreter.astcompiler.test.test_compiler.TestCompiler instance at 0x7fa748dca960>
source = " def fmeth(): # line 1\n ( # line 2\n o. # li... positions = list(co.co_positions())\n result = positions[opcodes.index('LOAD_METHOD')]\n "
evalexpr = 'result', expected = (4, 4, 8, 9)
def simple_test(self, source, evalexpr, expected):
> w_g = self.run(source)
interpreter/astcompiler/test/test_compiler.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
interpreter/astcompiler/test/test_compiler.py:55: in run
code.exec_code(space, w_dict, w_dict)
interpreter/eval.py:33: in exec_code
return frame.run()
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:91: in handle_bytecode
next_instr = self.handle_operation_error(ec, operr)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:313: in dispatch_bytecode
self.CALL_METHOD(oparg, next_instr)
objspace/std/callmethod.py:93: in CALL_METHOD
w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args+2)
interpreter/baseobjspace.py:1264: in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:204: in funccall_valuestack
return self.call_args(args)
interpreter/function.py:82: in call_args
w_res = self.getcode().funcrun(self, args)
interpreter/gateway.py:869: in funcrun
return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter/gateway.py:884: in funcrun_obj
self.handle_exception(space, e)
interpreter/gateway.py:878: in funcrun_obj
w_result = activation._run(space, scope_w)
<1070-codegen /build_dir/own-linux-x86-64/build/rpython/tool/sourcetools.py:200>:3: in _run
return self.behavior(space.interp_w(W_ListObject, scope_w[0]), space, scope_w[1], scope_w[2], scope_w[3])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = W_ListObject(<pypy.objspace.std.listobject.AsciiListStrategy object at 0x7fa74c3ce9d0>, ['LOAD_GLOBAL', 'RETURN_VALUE'])
space = StdObjSpace, w_value = W_UnicodeObject('LOAD_METHOD')
w_start = W_IntObject(0), w_stop = W_IntObject(9223372036854775807)
@unwrap_spec(w_start=WrappedDefault(0), w_stop=WrappedDefault(sys.maxint))
def descr_index(self, space, w_value, w_start, w_stop):
"""L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present."""
# needs to be safe against eq_w() mutating the w_list behind our back
size = self.length()
i, stop = unwrap_start_stop(space, size, w_start, w_stop)
# note that 'i' and 'stop' can be bigger than the length of the list
try:
i = self.find_or_count(w_value, i, stop)
except ValueError:
> raise oefmt(space.w_ValueError, "%R is not in list", w_value)
E OpErrFmt: [<W_TypeObject 'ValueError' at 0x7fa74ca090d0>: 'LOAD_METHOD' is not in list]
objspace/std/listobject.py:805: OpErrFmt
builder: own-linux-x86-64 build #10880+
test: pypy/interpreter/astcompiler/test/test_compiler.py::TestCompiler::()::test_load_method_position_multiline::[0]