pypy/module/_io/test/test_bufferedio.py::AppTestBufferedWriter::()::test_destructor
self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)>
func = <function <lambda> at 0xf27f1c6c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7c32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf49073ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf242ad6c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf242ad6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3969644>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf1920aac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf1920aac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_destructor'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_destructor'>
def runtest(self):
target = self.obj
if self.config.option.runappdirect:
return target()
space = target.im_self.space
filename = self._getdynfilename(target)
func = app2interp_temp(target.im_func, filename=filename)
w_instance = self.parent.w_instance
> self.execute_appex(space, func, space, w_instance)
tool/pytest/apptest.py:89:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_destructor'>, space = StdObjSpace
target = <function test_destructor at 0xf27e833c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>)
def execute_appex(self, space, target, *args):
self.space = space
try:
> target(*args)
tool/pytest/apptest.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>,)
w_func = <Function test_destructor>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>
def appcaller(space, *args_w):
if not isinstance(space, ObjSpace):
raise TypeError("first argument must be a space instance.")
# the last argument can be an Arguments
w_func = self.wget(space, name)
if not args_w:
return space.call_function(w_func)
else:
args = args_w[-1]
assert args is not None
if not isinstance(args, Arguments):
> return space.call_function(w_func, *args_w)
interpreter/gateway.py:1227:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_destructor>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>,)
nargs = 1, Function = <class 'pypy.interpreter.function.Function'>
Method = <class 'pypy.interpreter.function.Method'>
def call_function(self, w_func, *args_w):
nargs = len(args_w) # used for pruning funccall versions
if not self.config.objspace.disable_call_speedhacks and nargs < 5:
# start of hack for performance
from pypy.interpreter.function import Function, Method
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
if nargs < 4:
func = w_func.w_function
if isinstance(func, Function):
return func.funccall(w_inst, *args_w)
elif args_w and (
self.abstract_isinstance_w(args_w[0], w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
> return w_func.funccall(*args_w)
interpreter/baseobjspace.py:1210:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_destructor>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>,)
gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <code object test_destructor, file '[/build_dir/own-linux-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1>
def funccall(self, *args_w): # speed hack
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
nargs = len(args_w)
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, args_w[0])
elif nargs == 2:
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, args_w[0], args_w[1])
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
return code.fastcall_3(self.space, self, args_w[0],
args_w[1], args_w[2])
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
return code.fastcall_4(self.space, self, args_w[0],
args_w[1], args_w[2], args_w[3])
elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
if nargs < 5:
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in funccallunrolling:
if i < nargs:
new_frame.locals_cells_stack_w[i] = args_w[i]
> return new_frame.run()
interpreter/function.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16
def run(self):
"""Start this frame's execution."""
if self.getcode().co_flags & pycode.CO_GENERATOR:
from pypy.interpreter.generator import GeneratorIterator
return GeneratorIterator(self)
else:
> return self.execute_frame()
interpreter/pyframe.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16
w_inputvalue = None, operr = None
def execute_frame(self, w_inputvalue=None, operr=None):
"""Execute this frame. Main entry point to the interpreter.
The optional arguments are there to handle a generator's frame:
w_inputvalue is for generator.send() and operr is for
generator.throw().
"""
# the following 'assert' is an annotation hint: it hides from
# the annotator all methods that are defined in PyFrame but
# overridden in the {,Host}FrameClass subclasses of PyFrame.
assert (isinstance(self, self.space.FrameClass) or
not self.space.config.translating)
executioncontext = self.space.getexecutioncontext()
executioncontext.enter(self)
got_exception = True
w_exitvalue = self.space.w_None
try:
executioncontext.call_trace(self)
#
try:
if operr is not None:
next_instr = self.handle_operation_error(
executioncontext, operr)
self.last_instr = intmask(next_instr - 1)
else:
# Execution starts just after the last_instr. Initially,
# last_instr is -1. After a generator suspends it points to
# the YIELD_VALUE instruction.
next_instr = r_uint(self.last_instr + 1)
if next_instr != 0:
self.pushvalue(w_inputvalue)
w_exitvalue = self.dispatch(self.pycode, next_instr,
executioncontext)
except OperationError:
raise
except Exception as e: # general fall-back
> raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:290:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16
e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None))
def _convert_unexpected_exception(self, e):
from pypy.interpreter import error
> operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:943:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16
w_inputvalue = None, operr = None
def execute_frame(self, w_inputvalue=None, operr=None):
"""Execute this frame. Main entry point to the interpreter.
The optional arguments are there to handle a generator's frame:
w_inputvalue is for generator.send() and operr is for
generator.throw().
"""
# the following 'assert' is an annotation hint: it hides from
# the annotator all methods that are defined in PyFrame but
# overridden in the {,Host}FrameClass subclasses of PyFrame.
assert (isinstance(self, self.space.FrameClass) or
not self.space.config.translating)
executioncontext = self.space.getexecutioncontext()
executioncontext.enter(self)
got_exception = True
w_exitvalue = self.space.w_None
try:
executioncontext.call_trace(self)
#
try:
if operr is not None:
next_instr = self.handle_operation_error(
executioncontext, operr)
self.last_instr = intmask(next_instr - 1)
else:
# Execution starts just after the last_instr. Initially,
# last_instr is -1. After a generator suspends it points to
# the YIELD_VALUE instruction.
next_instr = r_uint(self.last_instr + 1)
if next_instr != 0:
self.pushvalue(w_inputvalue)
w_exitvalue = self.dispatch(self.pycode, next_instr,
> executioncontext)
interpreter/pyframe.py:286:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16
pycode = <code object test_destructor, file '[/build_dir/own-linux-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bb022c>
def dispatch(self, pycode, next_instr, ec):
# For the sequel, force 'next_instr' to be unsigned for performance
next_instr = r_uint(next_instr)
co_code = pycode.co_code
try:
while True:
> next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:63:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00g\x00\x00\x89\x01\x00d\x02\x00|\x01\x00j\x01\x00f\x01\x00\x87\x00\x00\x87\x01\x00...0\x00\x01\xcc\x1b\x00\x88\x01\x00d\x05\x00d\x06\x00d\x07\x00g\x03\x00k\x02\x00s\x87\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bb022c>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00g\x00\x00\x89\x01\x00d\x02\x00|\x01\x00j\x01\x00f\x01\x00\x87\x00\x00\x87\x01\x00...0\x00\x01\xcc\x1b\x00\x88\x01\x00d\x05\x00d\x06\x00d\x07\x00g\x03\x00k\x02\x00s\x87\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 101L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bb022c>
@jit.unroll_safe
def dispatch_bytecode(self, co_code, next_instr, ec):
while True:
self.last_instr = intmask(next_instr)
if jit.we_are_jitted():
if self.debugdata:
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
else:
ec.bytecode_trace(self)
next_instr = r_uint(self.last_instr)
opcode = ord(co_code[next_instr])
next_instr += 1
if opcode >= HAVE_ARGUMENT:
lo = ord(co_code[next_instr])
hi = ord(co_code[next_instr+1])
next_instr += 2
oparg = (hi * 256) | lo
else:
oparg = 0
# note: the structure of the code here is such that it makes
# (after translation) a big "if/elif" chain, which is then
# turned into a switch().
while opcode == opcodedesc.EXTENDED_ARG.index:
opcode = ord(co_code[next_instr])
if opcode < HAVE_ARGUMENT:
raise BytecodeCorruption
lo = ord(co_code[next_instr+1])
hi = ord(co_code[next_instr+2])
next_instr += 3
oparg = (oparg * 65536) | (hi * 256) | lo
if opcode == opcodedesc.RETURN_VALUE.index:
if not self.blockstack_non_empty():
self.frame_finished_execution = True # for generators
raise Return
w_returnvalue = self.popvalue()
block = self.unrollstack(SReturnValue.kind)
if block is None:
self.pushvalue(w_returnvalue)
raise Return
else:
unroller = SReturnValue(w_returnvalue)
next_instr = block.handle(self, unroller)
return next_instr # now inside a 'finally' block
elif opcode == opcodedesc.END_FINALLY.index:
unroller = self.end_finally()
if isinstance(unroller, SuspendedUnroller):
# go on unrolling the stack
block = self.unrollstack(unroller.kind)
if block is None:
w_result = unroller.nomoreblocks()
self.pushvalue(w_result)
raise Return
else:
next_instr = block.handle(self, unroller)
return next_instr
elif opcode == opcodedesc.JUMP_ABSOLUTE.index:
return self.jump_absolute(oparg, ec)
elif opcode == opcodedesc.BREAK_LOOP.index:
next_instr = self.BREAK_LOOP(oparg, next_instr)
elif opcode == opcodedesc.CONTINUE_LOOP.index:
return self.CONTINUE_LOOP(oparg, next_instr)
elif opcode == opcodedesc.FOR_ITER.index:
next_instr = self.FOR_ITER(oparg, next_instr)
elif opcode == opcodedesc.JUMP_FORWARD.index:
next_instr = self.JUMP_FORWARD(oparg, next_instr)
elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index:
next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr)
elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index:
next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr)
elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index:
next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr)
elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index:
next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr)
elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index:
next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr)
elif opcode == opcodedesc.BINARY_ADD.index:
self.BINARY_ADD(oparg, next_instr)
elif opcode == opcodedesc.BINARY_AND.index:
self.BINARY_AND(oparg, next_instr)
elif opcode == opcodedesc.BINARY_DIVIDE.index:
self.BINARY_DIVIDE(oparg, next_instr)
elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index:
self.BINARY_FLOOR_DIVIDE(oparg, next_instr)
elif opcode == opcodedesc.BINARY_LSHIFT.index:
self.BINARY_LSHIFT(oparg, next_instr)
elif opcode == opcodedesc.BINARY_MODULO.index:
self.BINARY_MODULO(oparg, next_instr)
elif opcode == opcodedesc.BINARY_MULTIPLY.index:
self.BINARY_MULTIPLY(oparg, next_instr)
elif opcode == opcodedesc.BINARY_OR.index:
self.BINARY_OR(oparg, next_instr)
elif opcode == opcodedesc.BINARY_POWER.index:
self.BINARY_POWER(oparg, next_instr)
elif opcode == opcodedesc.BINARY_RSHIFT.index:
self.BINARY_RSHIFT(oparg, next_instr)
elif opcode == opcodedesc.BINARY_SUBSCR.index:
self.BINARY_SUBSCR(oparg, next_instr)
elif opcode == opcodedesc.BINARY_SUBTRACT.index:
self.BINARY_SUBTRACT(oparg, next_instr)
elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index:
self.BINARY_TRUE_DIVIDE(oparg, next_instr)
elif opcode == opcodedesc.BINARY_XOR.index:
self.BINARY_XOR(oparg, next_instr)
elif opcode == opcodedesc.BUILD_CLASS.index:
self.BUILD_CLASS(oparg, next_instr)
elif opcode == opcodedesc.BUILD_LIST.index:
self.BUILD_LIST(oparg, next_instr)
elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index:
self.BUILD_LIST_FROM_ARG(oparg, next_instr)
elif opcode == opcodedesc.BUILD_MAP.index:
self.BUILD_MAP(oparg, next_instr)
elif opcode == opcodedesc.BUILD_SET.index:
self.BUILD_SET(oparg, next_instr)
elif opcode == opcodedesc.BUILD_SLICE.index:
self.BUILD_SLICE(oparg, next_instr)
elif opcode == opcodedesc.BUILD_TUPLE.index:
self.BUILD_TUPLE(oparg, next_instr)
elif opcode == opcodedesc.CALL_FUNCTION.index:
self.CALL_FUNCTION(oparg, next_instr)
elif opcode == opcodedesc.CALL_FUNCTION_KW.index:
self.CALL_FUNCTION_KW(oparg, next_instr)
elif opcode == opcodedesc.CALL_FUNCTION_VAR.index:
self.CALL_FUNCTION_VAR(oparg, next_instr)
elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index:
self.CALL_FUNCTION_VAR_KW(oparg, next_instr)
elif opcode == opcodedesc.CALL_METHOD.index:
self.CALL_METHOD(oparg, next_instr)
elif opcode == opcodedesc.COMPARE_OP.index:
self.COMPARE_OP(oparg, next_instr)
elif opcode == opcodedesc.DELETE_ATTR.index:
self.DELETE_ATTR(oparg, next_instr)
elif opcode == opcodedesc.DELETE_FAST.index:
self.DELETE_FAST(oparg, next_instr)
elif opcode == opcodedesc.DELETE_GLOBAL.index:
self.DELETE_GLOBAL(oparg, next_instr)
elif opcode == opcodedesc.DELETE_NAME.index:
self.DELETE_NAME(oparg, next_instr)
elif opcode == opcodedesc.DELETE_SLICE_0.index:
self.DELETE_SLICE_0(oparg, next_instr)
elif opcode == opcodedesc.DELETE_SLICE_1.index:
self.DELETE_SLICE_1(oparg, next_instr)
elif opcode == opcodedesc.DELETE_SLICE_2.index:
self.DELETE_SLICE_2(oparg, next_instr)
elif opcode == opcodedesc.DELETE_SLICE_3.index:
self.DELETE_SLICE_3(oparg, next_instr)
elif opcode == opcodedesc.DELETE_SUBSCR.index:
self.DELETE_SUBSCR(oparg, next_instr)
elif opcode == opcodedesc.DUP_TOP.index:
self.DUP_TOP(oparg, next_instr)
elif opcode == opcodedesc.DUP_TOPX.index:
self.DUP_TOPX(oparg, next_instr)
elif opcode == opcodedesc.EXEC_STMT.index:
self.EXEC_STMT(oparg, next_instr)
elif opcode == opcodedesc.GET_ITER.index:
self.GET_ITER(oparg, next_instr)
elif opcode == opcodedesc.IMPORT_FROM.index:
self.IMPORT_FROM(oparg, next_instr)
elif opcode == opcodedesc.IMPORT_NAME.index:
self.IMPORT_NAME(oparg, next_instr)
elif opcode == opcodedesc.IMPORT_STAR.index:
self.IMPORT_STAR(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_ADD.index:
self.INPLACE_ADD(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_AND.index:
self.INPLACE_AND(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_DIVIDE.index:
self.INPLACE_DIVIDE(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index:
self.INPLACE_FLOOR_DIVIDE(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_LSHIFT.index:
self.INPLACE_LSHIFT(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_MODULO.index:
self.INPLACE_MODULO(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_MULTIPLY.index:
self.INPLACE_MULTIPLY(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_OR.index:
self.INPLACE_OR(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_POWER.index:
self.INPLACE_POWER(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_RSHIFT.index:
self.INPLACE_RSHIFT(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_SUBTRACT.index:
self.INPLACE_SUBTRACT(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index:
self.INPLACE_TRUE_DIVIDE(oparg, next_instr)
elif opcode == opcodedesc.INPLACE_XOR.index:
self.INPLACE_XOR(oparg, next_instr)
elif opcode == opcodedesc.LIST_APPEND.index:
self.LIST_APPEND(oparg, next_instr)
elif opcode == opcodedesc.LOAD_ATTR.index:
self.LOAD_ATTR(oparg, next_instr)
elif opcode == opcodedesc.LOAD_CLOSURE.index:
self.LOAD_CLOSURE(oparg, next_instr)
elif opcode == opcodedesc.LOAD_CONST.index:
self.LOAD_CONST(oparg, next_instr)
elif opcode == opcodedesc.LOAD_DEREF.index:
self.LOAD_DEREF(oparg, next_instr)
elif opcode == opcodedesc.LOAD_FAST.index:
self.LOAD_FAST(oparg, next_instr)
elif opcode == opcodedesc.LOAD_GLOBAL.index:
self.LOAD_GLOBAL(oparg, next_instr)
elif opcode == opcodedesc.LOAD_LOCALS.index:
self.LOAD_LOCALS(oparg, next_instr)
elif opcode == opcodedesc.LOAD_NAME.index:
self.LOAD_NAME(oparg, next_instr)
elif opcode == opcodedesc.LOOKUP_METHOD.index:
> self.LOOKUP_METHOD(oparg, next_instr)
interpreter/pyopcode.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16
nameindex = 5, ignored = (101L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf3d9fd8c>
def LOOKUP_METHOD(f, nameindex, *ignored):
from pypy.objspace.std.typeobject import MutableCell
# stack before after
# -------------- --fast-method----fallback-case------------
#
# w_object None
# w_object => w_function w_boundmethod_or_whatever
# (more stuff) (more stuff) (more stuff)
#
space = f.space
w_obj = f.popvalue()
if not jit.we_are_jitted():
# mapdict has an extra-fast version of this function
if LOOKUP_METHOD_mapdict(f, nameindex, w_obj):
return
w_name = f.getname_w(nameindex)
w_value = None
w_type = space.type(w_obj)
if w_type.has_object_getattribute():
name = space.text_w(w_name)
# bit of a mess to use these internal functions, but it allows the
# mapdict caching below to work without an additional lookup
version_tag = w_type.version_tag()
if version_tag is None:
_, w_descr = w_type._lookup_where(name)
w_descr_cell = None
else:
_, w_descr_cell = w_type._pure_lookup_where_with_method_cache(
name, version_tag)
w_descr = w_descr_cell
if isinstance(w_descr, MutableCell):
w_descr = w_descr.unwrap_cell(space)
if w_descr is None:
# this handles directly the common case
# module.function(args..)
> w_value = w_obj.getdictvalue(space, name)
objspace/std/callmethod.py:63:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.gc.moduledef.Module object at 0xf3d9fd8c>
space = StdObjSpace, name = 'collect'
def getdictvalue(self, space, name):
w_value = space.finditem_str(self.w_dict, name)
if self.lazy and w_value is None:
> return self._load_lazily(space, name)
interpreter/mixedmodule.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.gc.moduledef.Module object at 0xf3d9fd8c>
space = StdObjSpace, name = 'collect'
def _load_lazily(self, space, name):
w_name = space.new_interned_str(name)
try:
loader = self.loaders[name]
except KeyError:
return None
else:
> w_value = loader(space)
interpreter/mixedmodule.py:103:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace
def ifileloader(space):
d = {'space':space}
# EVIL HACK (but it works, and this is not RPython :-)
while 1:
try:
value = eval(spec, d)
except NameError as ex:
name = ex.args[0].split("'")[1] # super-Evil
if name in d:
raise # propagate the NameError
try:
> d[name] = __import__(pkgroot+'.'+name, None, None, [name])
interpreter/mixedmodule.py:182:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
from pypy.interpreter.gateway import unwrap_spec
from pypy.interpreter.error import oefmt
from rpython.rlib import rgc
> from pypy.module.gc.hook import W_GcCollectStepStats
module/gc/interp_gc.py:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
from rpython.memory.gc.hook import GcHooks
> from rpython.memory.gc import incminimark
module/gc/hook.py:2:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"""
# XXX Should find a way to bound the major collection threshold by the
# XXX total addressable size. Maybe by keeping some minimarkpage arenas
# XXX pre-reserved, enough for a few nursery collections? What about
# XXX raw-malloced memory?
# XXX try merging old_objects_pointing_to_pinned into
# XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w)
import sys
import os
import time
from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup
from rpython.rtyper.lltypesystem.lloperation import llop
from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage
from rpython.memory.gc.base import GCBase, MovingGCBase
> from rpython.memory.gc import env
E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423
E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
../rpython/memory/gc/incminimark.py:70: SyntaxError
builder: own-linux-x86-32 build #9360
test: pypy/module/_io/test/test_bufferedio/py/AppTestBufferedWriter/()/test_destructor