virt_test/bin/python testrunner/runner.py --logfile=testrun.log --config=pypy/testrunner_cfg.py '--config=~/machine_cfg.py' --root=pypy --timeout=4000
in dir /build_dir/own-linux-x86-32/build (timeout 4000 secs)
watching logfiles {'pytestLog': 'testrun.log'}
argv: ['virt_test/bin/python', 'testrunner/runner.py', '--logfile=testrun.log', '--config=pypy/testrunner_cfg.py', '--config=~/machine_cfg.py', '--root=pypy', '--timeout=4000']
environment:
AUDITWHEEL_ARCH=i686
AUDITWHEEL_PLAT=manylinux2014_i686
AUDITWHEEL_POLICY=manylinux2014
DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-10/root
HOME=/home/buildslave
HOSTNAME=ffc60fde56a7
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LD_LIBRARY_PATH=/usr/local/lib:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib/dyninst
LOGNAME=buildslave
PATH=/python27_virt/bin:/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig
PWD=/build_dir/own-linux-x86-32/build
PYPYCHERRYPICK=
PYPY_LOCALBASE=/usr/local
PYPY_MAKE_PORTABLE=1
PYTHONPATH=.:
SHELL=/bin/bash
SHLVL=3
SSL_CERT_FILE=/opt/_internal/certs.pem
TERM=xterm
TMPDIR=/build_dir/tmp/pytest
USER=buildslave
_=/usr/bin/linux32
using PTY: False
using config pypy/testrunner_cfg.py
using config /home/buildslave/machine_cfg.py
running 4 parallel test workers
setting MAKEFLAGS to ' ' (space)
-- config/test
-- interpreter/astcompiler/test
-- interpreter/pyparser/test
-- interpreter/test
-- module/__builtin__/test
-- module/__pypy__/test
-- module/_ast/test
-- module/_cffi_backend/test
-- module/_codecs/test
-- module/_continuation/test
-- module/_cppyy/test
-- module/_csv/test
-- module/_demo/test
-- module/_file/test
-- module/_io/test
-- module/_jitlog/test
-- module/_locale/test
-- module/_lsprof/test
-- module/_md5/test
-- module/_minimal_curses/test
-- module/_multibytecodec/test
-- module/_multiprocessing/test
-- module/_pypyjson/test
-- module/_random/test
-- module/_rawffi/alt/test
-- module/_rawffi/test
-- module/_sha/test
-- module/_socket/test
-- module/_sre/test
-- module/_vmprof/test
-- module/_warnings/test
-- module/_weakref/test
-- module/_winreg/test
-- module/array/test
-- module/binascii/test
-- module/bz2/test
-- module/cStringIO/test
-- module/cmath/test
-- module/cpyext/test/test_abstract.py
-- module/cpyext/test/test_api.py
-- module/cpyext/test/test_arraymodule.py
-- module/cpyext/test/test_boolobject.py
-- module/cpyext/test/test_borrow.py
-- module/cpyext/test/test_bufferobject.py
-- module/cpyext/test/test_bytearrayobject.py
-- module/cpyext/test/test_bytesobject.py
-- module/cpyext/test/test_capsule.py
-- module/cpyext/test/test_cell.py
-- module/cpyext/test/test_classobject.py
-- module/cpyext/test/test_codecs.py
-- module/cpyext/test/test_complexobject.py
-- module/cpyext/test/test_cpyext.py
-- module/cpyext/test/test_datetime.py
-- module/cpyext/test/test_dictobject.py
-- module/cpyext/test/test_eval.py
-- module/cpyext/test/test_fileobject.py
-- module/cpyext/test/test_floatobject.py
-- module/cpyext/test/test_frameobject.py
-- module/cpyext/test/test_funcobject.py
-- module/cpyext/test/test_genobject.py
-- module/cpyext/test/test_getargs.py
-- module/cpyext/test/test_import.py
-- module/cpyext/test/test_intobject.py
-- module/cpyext/test/test_iterator.py
-- module/cpyext/test/test_listobject.py
-- module/cpyext/test/test_longobject.py
-- module/cpyext/test/test_mapping.py
-- module/cpyext/test/test_marshal.py
-- module/cpyext/test/test_memoryobject.py
-- module/cpyext/test/test_methodobject.py
-- module/cpyext/test/test_misc.py
-- module/cpyext/test/test_module.py
-- module/cpyext/test/test_ndarrayobject.py
-- module/cpyext/test/test_number.py
-- module/cpyext/test/test_object.py
-- module/cpyext/test/test_pycobject.py
-- module/cpyext/test/test_pyerrors.py
-- module/cpyext/test/test_pyfile.py
-- module/cpyext/test/test_pysignals.py
-- module/cpyext/test/test_pystate.py
-- module/cpyext/test/test_pystrtod.py
-- module/cpyext/test/test_sequence.py
-- module/cpyext/test/test_setobject.py
-- module/cpyext/test/test_sliceobject.py
-- module/cpyext/test/test_structseq.py
-- module/cpyext/test/test_sysmodule.py
-- module/cpyext/test/test_thread.py
-- module/cpyext/test/test_traceback.py
-- module/cpyext/test/test_translate.py
-- module/cpyext/test/test_tupleobject.py
-- module/cpyext/test/test_typeobject.py
-- module/cpyext/test/test_unicodeobject.py
-- module/cpyext/test/test_userslots.py
-- module/cpyext/test/test_version.py
-- module/cpyext/test/test_weakref.py
-- module/crypt/test
-- module/errno/test
-- module/exceptions/test
-- module/faulthandler/test
-- module/fcntl/test
-- module/gc/test
-- module/imp/test
-- module/itertools/test
-- module/marshal/test
-- module/math/test
-- module/micronumpy/test
-- module/mmap/test
-- module/operator/test
-- module/parser/test
-- module/posix/test
-- module/pwd/test
-- module/pyexpat/test
-- module/pypyjit/test
-- module/select/test
-- module/signal/test
-- module/struct/test
-- module/sys/test
-- module/termios/test
-- module/test_lib_pypy
-- module/thread/test
-- module/time/test
-- module/unicodedata/test
-- module/zipimport/test
-- module/zlib/test
-- objspace/fake/test
-- objspace/std/test
-- objspace/test
-- sandbox/test
-- tool/bench/test
-- tool/memusage/test
-- tool/pytest/test
-- tool/release/test
-- tool/test
-- total: 133 to run
++ 08:24:45 starting config/test [1 started in total]
++ 08:24:45 starting interpreter/pyparser/test [2 started in total]
++ 08:24:45 starting interpreter/test [3 started in total]
++ 08:24:45 starting interpreter/astcompiler/test [4 started in total]
__ config/test [1 done in total, somefailed=False] ____________________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 157 items / 1 skipped
config/test/test_pypyoption.py .............................................................................................................................................................
==================== 157 passed, 1 skipped in 10.47 seconds ====================
++ 08:24:57 starting module/__builtin__/test [5 started in total]
__ module/__builtin__/test [2 done in total, somefailed=True] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 305 items
module/__builtin__/test/apptest_compile.py ........
module/__builtin__/test/test_abstractinst.py ............
module/__builtin__/test/test_apply.py ...
module/__builtin__/test/test_builtin.py ..............................................s.....................
module/__builtin__/test/test_classobj.py ........................................F..F...............
module/__builtin__/test/test_descriptor.py ..........................
module/__builtin__/test/test_filter.py ...........
module/__builtin__/test/test_functional.py .................................................
module/__builtin__/test/test_minmax.py ..........................
module/__builtin__/test/test_range.py ........................
module/__builtin__/test/test_rawinput.py ...
module/__builtin__/test/test_reduce.py ....
module/__builtin__/test/test_vars.py ...
module/__builtin__/test/test_zip.py .........
=================================== FAILURES ===================================
___________________________ AppTestOldstyle.test_del ___________________________
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 0xf47cd95c>, 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_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_del'>}
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 0xf7aad32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a4a4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_del'>}
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 0xf6a4a4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_del'>}
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_del'>, '__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 0xf4923194>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__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 0xf4775d2c>
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 0xf4775d2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__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_del'>, '__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 0xf47e7cfc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__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 0xf477596c>
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 0xf477596c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__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_del'>, '__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_del'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_del'>
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_del'>, space = StdObjSpace
target = <function test_del at 0xf47cdfb4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4775b0c>)
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 0xf4775b0c>,)
w_func = <Function test_del>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4775b0c>
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_del>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4775b0c>,)
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_del>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4775b0c>,)
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_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/__builtin__/test/test_classobj.py:668]', 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_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9
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_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9
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_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9
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_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9
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_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9
pycode = <code object test_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cdd7cc>
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_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00g\x00\x00\x89\x00\x00d\x02\x00f\x00\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...00\xca\x00\x00\x01\xcc\x18\x00\x88\x00\x00d\x04\x00d\x04\x00g\x02\x00k\x02\x00s\xce\x00t\x02\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cdd7cc>
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_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00g\x00\x00\x89\x00\x00d\x02\x00f\x00\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...00\xca\x00\x00\x01\xcc\x18\x00\x88\x00\x00d\x04\x00d\x04\x00g\x02\x00k\x02\x00s\xce\x00t\x02\x00\x82\x01\x00d\x00\x00S'
next_instr = 64L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cdd7cc>
@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_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9
nameindex = 1, ignored = (64L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c9c76c>
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 0xf4c9c76c>
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 0xf4c9c76c>
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
_________________________ AppTestOldstyle.test_weakref _________________________
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 0xf47cde64>, 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_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>}
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 0xf7aad32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a4a4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>}
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 0xf6a4a4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>}
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_weakref'>, '__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 0xf49c9cfc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__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 0xf49b1a2c>
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 0xf49b1a2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__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_weakref'>, '__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 0xf49c98ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__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 0xf49b1e2c>
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 0xf49b1e2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__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_weakref'>, '__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_weakref'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_weakref'>
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_weakref'>, space = StdObjSpace
target = <function test_weakref at 0xf463b72c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4775b0c>)
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 0xf4775b0c>,)
w_func = <Function test_weakref>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4775b0c>
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_weakref>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4775b0c>,)
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_weakref>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4775b0c>,)
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_weakref, file '[/build_dir/own-linux-x86-32/build/pypy/module/__builtin__/test/test_classobj.py:725]', 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_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9
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_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9
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_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9
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_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9
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_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9
pycode = <code object test_weakref, file '[/build_dir/own-linux-x86-32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cdd7cc>
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_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00f\x00\x00d\x03\x00\x84\x00\x00\x83\x...xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\x97\x00t\x03\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cdd7cc>
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_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00f\x00\x00d\x03\x00\x84\x00\x00\x83\x...xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\x97\x00t\x03\x00\x82\x01\x00d\x00\x00S'
next_instr = 103L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cdd7cc>
@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_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9
nameindex = 4, ignored = (103L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c9c76c>
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 0xf4c9c76c>
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 0xf4c9c76c>
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
=========================== short test summary info ============================
FAIL module/__builtin__/test/test_classobj.py::AppTestOldstyle::()::test_del
FAIL module/__builtin__/test/test_classobj.py::AppTestOldstyle::()::test_weakref
=============== 2 failed, 302 passed, 1 skipped in 49.29 seconds ===============
++ 08:25:48 starting module/__pypy__/test [6 started in total]
__ interpreter/astcompiler/test [3 done in total, somefailed=False] ___________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.py
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 447 items
interpreter/astcompiler/test/apptest_misc.py .
interpreter/astcompiler/test/test_ast.py .......
interpreter/astcompiler/test/test_astbuilder.py .....................................................
interpreter/astcompiler/test/test_compiler.py ..........................................................................................................................................................................................................................................................................................................................................................................
interpreter/astcompiler/test/test_misc.py .
interpreter/astcompiler/test/test_symtable.py .......................
========================= 447 passed in 89.07 seconds ==========================
++ 08:26:19 starting module/_ast/test [7 started in total]
__ module/__pypy__/test [4 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 68 items
module/__pypy__/test/test_builders.py .....
module/__pypy__/test/test_bytebuffer.py ..
module/__pypy__/test/test_debug.py .......
module/__pypy__/test/test_identitydict.py ......
module/__pypy__/test/test_intop.py ...........
module/__pypy__/test/test_locals2fast.py .....
module/__pypy__/test/test_magic.py .....s.
module/__pypy__/test/test_newmemoryview.py ...
module/__pypy__/test/test_os.py .
module/__pypy__/test/test_signal.py ....s
module/__pypy__/test/test_special.py ..........s.s
module/__pypy__/test/test_time.py ...
==================== 64 passed, 4 skipped in 30.46 seconds =====================
++ 08:26:21 starting module/_cffi_backend/test [8 started in total]
__ module/_ast/test [5 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 36 items
module/_ast/test/test_ast.py ....................................
========================== 36 passed in 24.34 seconds ==========================
++ 08:26:47 starting module/_codecs/test [9 started in total]
__ module/_codecs/test [6 done in total, somefailed=False] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 65 items
module/_codecs/test/test_codecs.py ................................................................
module/_codecs/test/test_ztranslation.py .
========================== 65 passed in 41.94 seconds ==========================
++ 08:27:31 starting module/_continuation/test [10 started in total]
__ module/_cffi_backend/test [7 done in total, somefailed=True] _______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 466 items
module/_cffi_backend/test/test_c.py ....................................................................................s.....................F.....................F........s.....s.......................s..Exception KeyError: (<C object Array of Char {'nolength': True} at 0xf3bdea70>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf48d87ac>> ignored
F........FException KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '9', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3f1932c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '8', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3f1926c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '7', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3f1988c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '6', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3f19c2c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '5', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3f193ec>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '4', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3f19f8c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '3', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf46f384c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '2', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf47e322c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '1', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf46163ec>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '0', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf460804c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '9', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3bfa2ac>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '8', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3bfaf2c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '7', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf45c94cc>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '6', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf45c9a0c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '5', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf5b1d98c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '4', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf455814c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '3', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf40f6aec>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '2', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf40f67cc>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf40f640c>> ignored
Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '0', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf40f6c6c>> ignored
F..............F.s........................s......
module/_cffi_backend/test/test_fastpath.py ..................
module/_cffi_backend/test/test_ffi_obj.py ..............................F..............
module/_cffi_backend/test/test_file.py s..
module/_cffi_backend/test/test_parse_c_type.py ..............s...
module/_cffi_backend/test/test_re_python.py ....................
module/_cffi_backend/test/test_recompiler.py .........................................................................................s..s...............................
module/_cffi_backend/test/test_unicode_literals.py .......
module/_cffi_backend/test/test_wchar_helper.py .
module/_cffi_backend/test/test_ztranslation.py s
=================================== FAILURES ===================================
____________________________ AppTestC.test_weakref _____________________________
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 0xf4228b1c>, 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_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>}
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 0xf7a9e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>}
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 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>}
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_weakref'>, '__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 0xf421275c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__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 0xf4c91b0c>
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 0xf4c91b0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__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_weakref'>, '__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 0xf4212e14>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__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 0xf4c9128c>
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 0xf4c9128c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__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_weakref'>, '__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_weakref'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_weakref'>
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_weakref'>, space = StdObjSpace
target = <function test_weakref at 0xf4230924>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>)
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 0xf484a2ac>,)
w_func = <Function test_weakref>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>
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_weakref>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_weakref>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_weakref, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', 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_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
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_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
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_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
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_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
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_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
pycode = <code object test_weakref, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 21L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_weakref>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
dropvalues = 2, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_weakref>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
dropvalues = 2, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
> return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_weakref>
code = <code object test_weakref, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:320]', line 1> at line 3
dropvalues = 2
@jit.unroll_safe
def _flat_pycall(self, code, nargs, frame, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793> at line 1804
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_weakref,.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793> at line 1804
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_weakref,.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793> at line 1804
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_weakref,.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793> at line 1804
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_weakref,.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793> at line 1804
pycode = <code object test_weakref, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_weakref,.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793> at line 1804
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00d\x02\x00\x83\x01\x00}\x01\x00t\x02\x00|\x01\x00\x83\x01\x00}\x02\x00|\x...x00|\x03\x00\xcb\x00\x00D]\x0c\x00}\x06\x00d\x00\x00^\x02\x00q\xd9\x00k\x02\x00r\xf2\x00Pq\x9d\x00q\x9d\x00Wd\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_weakref,.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793> at line 1804
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00d\x02\x00\x83\x01\x00}\x01\x00t\x02\x00|\x01\x00\x83\x01\x00}\x02\x00|\x...x00|\x03\x00\xcb\x00\x00D]\x0c\x00}\x06\x00d\x00\x00^\x02\x00q\xd9\x00k\x02\x00r\xf2\x00Pq\x9d\x00q\x9d\x00Wd\x00\x00S'
next_instr = 181L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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_weakref,.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 1793> at line 1804
nameindex = 9, ignored = (181L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4e65d2c>
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 0xf4e65d2c>
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 0xf4e65d2c>
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
________________________ AppTestC.test_keepalive_struct ________________________
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 0xf4109e64>, 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_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keepalive_struct'>}
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 0xf7a9e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keepalive_struct'>}
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 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keepalive_struct'>}
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_keepalive_struct'>, '__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 0xf422baa4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ive_struct'>, '__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 0xf487360c>
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 0xf487360c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ive_struct'>, '__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_keepalive_struct'>, '__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 0xf3c4384c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ive_struct'>, '__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 0xf4b5104c>
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 0xf4b5104c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ive_struct'>, '__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_keepalive_struct'>, '__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_keepalive_struct'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_keepalive_struct'>
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_keepalive_struct'>, space = StdObjSpace
target = <function test_keepalive_struct at 0xf3cbb614>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>)
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 0xf484a2ac>,)
w_func = <Function test_keepalive_struct>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>
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_keepalive_struct>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_keepalive_struct>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_keepalive_struct, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', 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_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
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_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
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_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
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_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
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_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
pycode = <code object test_keepalive_struct, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 21L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_keepalive_struct>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
dropvalues = 2, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_keepalive_struct>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
dropvalues = 2, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
> return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_keepalive_struct>
code = <code object test_keepalive_struct, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:386]', line 1> at line 3
dropvalues = 2
@jit.unroll_safe
def _flat_pycall(self, code, nargs, frame, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303> at line 2321
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_keepaliv.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303> at line 2321
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_keepaliv.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303> at line 2321
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_keepaliv.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303> at line 2321
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_keepaliv.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303> at line 2321
pycode = <code object test_keepalive_struct, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_keepaliv.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303> at line 2321
co_code = 't\x00\x00d\x01\x00\x83\x01\x00}\x00\x00t\x01\x00|\x00\x00\x83\x01\x00}\x01\x00t\x02\x00|\x00\x00d\x02\x00t\x03\x00d\x...\x02\x00sE\x01t\x06\x00\x82\x01\x00\xcc\x15\x00|\x03\x00j\x07\x00d\n\x00k\x02\x00s]\x01t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_keepaliv.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303> at line 2321
co_code = 't\x00\x00d\x01\x00\x83\x01\x00}\x00\x00t\x01\x00|\x00\x00\x83\x01\x00}\x01\x00t\x02\x00|\x00\x00d\x02\x00t\x03\x00d\x...\x02\x00sE\x01t\x06\x00\x82\x01\x00\xcc\x15\x00|\x03\x00j\x07\x00d\n\x00k\x02\x00s]\x01t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 270L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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_keepaliv.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 2303> at line 2321
nameindex = 11, ignored = (270L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4e65d2c>
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 0xf4e65d2c>
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 0xf4e65d2c>
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
________________________ AppTestC.test_buffer_keepalive ________________________
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 0xf3ccd8ec>, 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_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer_keepalive'>}
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 0xf7a9e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer_keepalive'>}
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 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer_keepalive'>}
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_buffer_keepalive'>, '__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 0xf40b6f7c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._keepalive'>, '__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 0xf40f616c>
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 0xf40f616c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._keepalive'>, '__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_buffer_keepalive'>, '__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 0xf40da4dc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._keepalive'>, '__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 0xf40f618c>
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 0xf40f618c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._keepalive'>, '__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_buffer_keepalive'>, '__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_buffer_keepalive'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_buffer_keepalive'>
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_buffer_keepalive'>, space = StdObjSpace
target = <function test_buffer_keepalive at 0xf40d1d84>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>)
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 0xf484a2ac>,)
w_func = <Function test_buffer_keepalive>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>
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_buffer_keepalive>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_buffer_keepalive>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_buffer_keepalive, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', 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_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
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_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
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_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
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_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
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_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
pycode = <code object test_buffer_keepalive, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 21L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_buffer_keepalive>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
dropvalues = 2, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_buffer_keepalive>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
dropvalues = 2, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
> return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_buffer_keepalive>
code = <code object test_buffer_keepalive, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:512]', line 1> at line 3
dropvalues = 2
@jit.unroll_safe
def _flat_pycall(self, code, nargs, frame, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101> at line 3108
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_buffer_k.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101> at line 3108
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_buffer_k.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101> at line 3108
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_buffer_k.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101> at line 3108
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_buffer_k.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101> at line 3108
pycode = <code object test_buffer_keepalive, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101>
next_instr = 52
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_buffer_k.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101> at line 3108
co_code = 't\x00\x00t\x01\x00d\x01\x00\x83\x01\x00\x83\x01\x00}\x00\x00t\x02\x00|\x00\x00d\x00\x00\x83\x02\x00}\x01\x00g\x00\x00...d\x00|\x06\x00\x1et\x05\x00d\x05\x00|\x03\x00\x16\x83\x01\x00k\x02\x00s\xbd\x00t\n\x00\x82\x01\x00q\x8d\x00Wd\x00\x00S'
next_instr = 52
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_buffer_k.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101> at line 3108
co_code = 't\x00\x00t\x01\x00d\x01\x00\x83\x01\x00\x83\x01\x00}\x00\x00t\x02\x00|\x00\x00d\x00\x00\x83\x02\x00}\x01\x00g\x00\x00...d\x00|\x06\x00\x1et\x05\x00d\x05\x00|\x03\x00\x16\x83\x01\x00k\x02\x00s\xbd\x00t\n\x00\x82\x01\x00q\x8d\x00Wd\x00\x00S'
next_instr = 124L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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_buffer_k.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3101> at line 3108
nameindex = 9, ignored = (124L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4e65d2c>
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 0xf4e65d2c>
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 0xf4e65d2c>
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
___________________________ AppTestC.test_new_handle ___________________________
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 0xf3fed614>, 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_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle'>}
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 0xf7a9e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle'>}
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 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle'>}
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_new_handle'>, '__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 0xf40cae8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...new_handle'>, '__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 0xf48b31ac>
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 0xf48b31ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...new_handle'>, '__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_new_handle'>, '__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 0xf40caf54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...new_handle'>, '__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 0xf48b3a4c>
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 0xf48b3a4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...new_handle'>, '__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_new_handle'>, '__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_new_handle'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_new_handle'>
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_new_handle'>, space = StdObjSpace
target = <function test_new_handle at 0xf3fedf7c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>)
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 0xf484a2ac>,)
w_func = <Function test_new_handle>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>
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_new_handle>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_new_handle>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_new_handle, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', 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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
pycode = <code object test_new_handle, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 21L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_new_handle>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
dropvalues = 2, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_new_handle>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
dropvalues = 2, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
> return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_new_handle>
code = <code object test_new_handle, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:539]', line 1> at line 3
dropvalues = 2
@jit.unroll_safe
def _flat_pycall(self, code, nargs, frame, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223> at line 3237
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223> at line 3237
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223> at line 3237
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223> at line 3237
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223> at line 3237
pycode = <code object test_new_handle, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223> at line 3237
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00t\x02\x00\x83\x00\x00\x83\x01\x00}\x01\x00t\x01\x00t\x03\x00d\x02\x00\x8...07\x00\x82\x01\x00t\x0e\x00\xc9\x0f\x00t\x10\x00t\x08\x00t\t\x00|\x02\x00d\n\x00\x83\x02\x00\xca\x03\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223> at line 3237
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00t\x02\x00\x83\x00\x00\x83\x01\x00}\x01\x00t\x01\x00t\x03\x00d\x02\x00\x8...07\x00\x82\x01\x00t\x0e\x00\xc9\x0f\x00t\x10\x00t\x08\x00t\t\x00|\x02\x00d\n\x00\x83\x02\x00\xca\x03\x00\x01d\x00\x00S'
next_instr = 244L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3223> at line 3237
nameindex = 12, ignored = (244L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4e65d2c>
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 0xf4e65d2c>
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 0xf4e65d2c>
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
________________________ AppTestC.test_new_handle_cycle ________________________
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 0xf3fed6f4>, 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_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle_cycle'>}
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 0xf7a9e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle_cycle'>}
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 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle_cycle'>}
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_new_handle_cycle'>, '__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 0xf3cad7fc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ndle_cycle'>, '__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 0xf3adc32c>
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 0xf3adc32c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ndle_cycle'>, '__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_new_handle_cycle'>, '__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 0xf3cad75c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ndle_cycle'>, '__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 0xf3adc28c>
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 0xf3adc28c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ndle_cycle'>, '__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_new_handle_cycle'>, '__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_new_handle_cycle'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_new_handle_cycle'>
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_new_handle_cycle'>, space = StdObjSpace
target = <function test_new_handle_cycle at 0xf400148c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>)
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 0xf484a2ac>,)
w_func = <Function test_new_handle_cycle>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>
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_new_handle_cycle>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_new_handle_cycle>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_new_handle_cycle, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', 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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
pycode = <code object test_new_handle_cycle, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 21L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_new_handle_cycle>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
dropvalues = 2, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_new_handle_cycle>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
dropvalues = 2, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
> return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_new_handle_cycle>
code = <code object test_new_handle_cycle, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:542]', line 1> at line 3
dropvalues = 2
@jit.unroll_safe
def _flat_pycall(self, code, nargs, frame, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248> at line 3259
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248> at line 3259
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248> at line 3259
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248> at line 3259
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248> at line 3259
pycode = <code object test_new_handle_cycle, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248> at line 3259
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00t\x02\x00\x83\x00\x00\x83\x01\x00}\x01\x00d\x02\x00t\x03\x00f\x01\x00d\x...\xca\x00\x00\x01qk\x00qk\x00W\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00s\xb5\x00t\n\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248> at line 3259
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00t\x02\x00\x83\x00\x00\x83\x01\x00}\x01\x00d\x02\x00t\x03\x00f\x01\x00d\x...\xca\x00\x00\x01qk\x00qk\x00W\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00s\xb5\x00t\n\x00\x82\x01\x00d\x00\x00S'
next_instr = 146L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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_new_hand.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3248> at line 3259
nameindex = 9, ignored = (146L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4e65d2c>
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 0xf4e65d2c>
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 0xf4e65d2c>
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
__________________ AppTestC.test_from_buffer_not_str_unicode ___________________
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 0xf3b73f7c>, 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_from_buffer_not_str_unicode'>, ...ticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>}
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 0xf7a9e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>, ...ticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>}
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 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>, ...ticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>}
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_from_buffer_not_str_unicode'>, '__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 0xf3c43aa4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...tr_unicode'>, '__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 0xf3aca8cc>
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 0xf3aca8cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...tr_unicode'>, '__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_from_buffer_not_str_unicode'>, '__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 0xf3cbe20c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...tr_unicode'>, '__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 0xf3aca82c>
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 0xf3aca82c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...tr_unicode'>, '__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_from_buffer_not_str_unicode'>, '__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_from_buffer_not_str_unicode'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_from_buffer_not_str_unicode'>
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_from_buffer_not_str_unicode'>, space = StdObjSpace
target = <function test_from_buffer_not_str_unicode at 0xf3b1b844>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>)
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 0xf484a2ac>,)
w_func = <Function test_from_buffer_not_str_unicode>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>
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_from_buffer_not_str_unicode>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_from_buffer_not_str_unicode>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf484a2ac>,)
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_from_buffer_not_str_unicode, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', 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_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
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_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
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_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
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_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
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_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
pycode = <code object test_from_buffer_not_str_unicode, file '[/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 21L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_from_buffer_not_str_unicode>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
dropvalues = 2, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_from_buffer_not_str_unicode>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
dropvalues = 2, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
> return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_from_buffer_not_str_unicode>
code = <code object test_from_buffer_not_str_unicode, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...r/tmp/pytest/usession-win-rpython-54/test_c/_test_c.py:587]', line 1> at line 3
dropvalues = 2
@jit.unroll_safe
def _flat_pycall(self, code, nargs, frame, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706> at line 3712
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_from_buf.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706> at line 3712
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_from_buf.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706> at line 3712
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_from_buf.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706> at line 3712
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_from_buf.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706> at line 3712
pycode = <code object test_from_buffer_not_str_unicode, file '/build_dir/tmp/pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_from_buf.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706> at line 3712
co_code = 't\x00\x00d\x01\x00\x83\x01\x00}\x00\x00t\x01\x00|\x00\x00\x83\x01\x00}\x01\x00t\x02\x00|\x01\x00d\x00\x00\x83\x02\x00...}\x07\x00\xcc\x1a\x00|\x06\x00|\x07\x00\x19|\x03\x00|\x07\x00\x19k\x02\x00sR\x02t\x04\x00\x82\x01\x00q/\x02Wd\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
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_from_buf.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706> at line 3712
co_code = 't\x00\x00d\x01\x00\x83\x01\x00}\x00\x00t\x01\x00|\x00\x00\x83\x01\x00}\x01\x00t\x02\x00|\x01\x00d\x00\x00\x83\x02\x00...}\x07\x00\xcc\x1a\x00|\x06\x00|\x07\x00\x19|\x03\x00|\x07\x00\x19k\x02\x00sR\x02t\x04\x00\x82\x01\x00q/\x02Wd\x00\x00S'
next_instr = 102L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cb304c>
@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_from_buf.../pytest/usession-win-rpython-54/test_c/_all_test_c.py', line 3706> at line 3712
nameindex = 6, ignored = (102L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4e65d2c>
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 0xf4e65d2c>
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 0xf4e65d2c>
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
______________________ AppTestFFIObj.test_ffi_gc_disable _______________________
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 0xf415adbc>, 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_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_ffi_gc_disable'>}
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 0xf7a9e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_ffi_gc_disable'>}
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 0xf6a3a68c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_ffi_gc_disable'>}
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_ffi_gc_disable'>, '__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 0xf3a24a04>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...gc_disable'>, '__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 0xf41594ec>
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 0xf41594ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...gc_disable'>, '__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_ffi_gc_disable'>, '__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 0xf3836a54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...gc_disable'>, '__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 0xf415932c>
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 0xf415932c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...gc_disable'>, '__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_ffi_gc_disable'>, '__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_ffi_gc_disable'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_ffi_gc_disable'>
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_ffi_gc_disable'>, space = StdObjSpace
target = <function test_ffi_gc_disable at 0xf4126e9c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3ac97cc>)
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 0xf3ac97cc>,)
w_func = <Function test_ffi_gc_disable>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3ac97cc>
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_ffi_gc_disable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3ac97cc>,)
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_ffi_gc_disable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3ac97cc>,)
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_ffi_gc_disable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', 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_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9
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_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9
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_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9
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_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9
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_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9
pycode = <code object test_ffi_gc_disable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf57f5dac>
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_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00}\x02\x00|\x02\x00\xc9\x02\x00d\x02\x00d\x03\x00...\x00\xca\x00\x00\x01q\xe1\x00W\xcc\x15\x00\x88\x00\x00d\x08\x00g\x01\x00k\x02\x00s#\x01t\x07\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf57f5dac>
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_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00}\x02\x00|\x02\x00\xc9\x02\x00d\x02\x00d\x03\x00...\x00\xca\x00\x00\x01q\xe1\x00W\xcc\x15\x00\x88\x00\x00d\x08\x00g\x01\x00k\x02\x00s#\x01t\x07\x00\x82\x01\x00d\x00\x00S'
next_instr = 148L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf57f5dac>
@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_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9
nameindex = 6, ignored = (148L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf3ad9e6c>
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 0xf3ad9e6c>
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 0xf3ad9e6c>
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
=========================== short test summary info ============================
FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_weakref
FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_keepalive_struct
FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_buffer_keepalive
FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_new_handle
FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_new_handle_cycle
FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_from_buffer_not_str_unicode
FAIL module/_cffi_backend/test/test_ffi_obj.py::AppTestFFIObj::()::test_ffi_gc_disable
============== 7 failed, 448 passed, 11 skipped in 193.44 seconds ==============
++ 08:29:36 starting module/_cppyy/test [11 started in total]
__ module/_continuation/test [8 done in total, somefailed=False] ______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 52 items / 2 skipped
module/_continuation/test/test_generator.py ....
module/_continuation/test/test_greenlet.py ............................
module/_continuation/test/test_zpickle.py ....................
==================== 52 passed, 2 skipped in 122.55 seconds ====================
++ 08:29:42 starting module/_csv/test [12 started in total]
__ module/_csv/test [9 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 23 items
module/_csv/test/test_dialect.py .........
module/_csv/test/test_reader.py .........
module/_csv/test/test_writer.py ....
module/_csv/test/test_ztranslation.py .
========================== 23 passed in 17.24 seconds ==========================
++ 08:30:02 starting module/_demo/test [13 started in total]
__ module/_demo/test [10 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items
module/_demo/test/test_import.py ..
module/_demo/test/test_sieve.py .
========================== 3 passed in 11.15 seconds ===========================
++ 08:30:14 starting module/_file/test [14 started in total]
__ interpreter/pyparser/test [11 done in total, somefailed=False] _____________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 119 items
interpreter/pyparser/test/test_automata.py ...
interpreter/pyparser/test/test_future.py .....................................
interpreter/pyparser/test/test_gendfa.py .
interpreter/pyparser/test/test_metaparser.py ...............
interpreter/pyparser/test/test_parser.py .............
interpreter/pyparser/test/test_parsestring.py .........
interpreter/pyparser/test/test_pyparse.py ....................................
interpreter/pyparser/test/test_pytokenizer.py .....
========================= 119 passed in 24.61 seconds ==========================
++ 08:31:25 starting module/_io/test [15 started in total]
__ interpreter/test [12 done in total, somefailed=True] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.py
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 772 items
interpreter/test/apptest_class.py ...............
interpreter/test/apptest_exec.py ............................
interpreter/test/apptest_function.py ........................s..............................
interpreter/test/apptest_generator.py ......................F...........
interpreter/test/apptest_nestedscope.py .............
interpreter/test/apptest_pyframe.py .............................
interpreter/test/apptest_raise.py .....................
interpreter/test/test_app_main.py ....ssssssssssssssssssssssssss.sssssss.............s...s..s......
interpreter/test/test_appinterp.py .............
interpreter/test/test_argument.py ...................................
interpreter/test/test_buffer.py ..
interpreter/test/test_cellfamily.py .......
interpreter/test/test_code.py ........
interpreter/test/test_compiler.py .........................................................................................................................
interpreter/test/test_descrtypecheck.py ..
interpreter/test/test_error.py ..........
interpreter/test/test_exceptcomp.py ...........
interpreter/test/test_exec.py .
interpreter/test/test_executioncontext.py ................
interpreter/test/test_extmodules.py .
interpreter/test/test_function.py ..........
interpreter/test/test_gateway.py ........................................ss............
interpreter/test/test_generator.py .
interpreter/test/test_interpreter.py ..........................
interpreter/test/test_main.py ....
interpreter/test/test_mixedmodule.py ......
interpreter/test/test_module.py ........
interpreter/test/test_objspace.py ..............................
interpreter/test/test_pycode.py .
interpreter/test/test_pyframe.py ..
interpreter/test/test_reverse_debugging.py ..
interpreter/test/test_special.py ..
interpreter/test/test_syntax.py ....................................................................
interpreter/test/test_targetpypy.py ..
interpreter/test/test_typedef.py ....F.......F.....
interpreter/test/test_unicodehelper.py ..........
interpreter/test/test_zpy.py ......
interpreter/test/test_zzpickle_and_slow.py ...............s...................
=================================== FAILURES ===================================
____________________________ test_close_on_collect _____________________________
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 0xf515764c>, 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': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_close_on_collect'>}
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 0xf7a40c6c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69f2f8c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_close_on_collect'>}
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 0xf69f2f8c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_close_on_collect'>}
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': <AppTestFunction 'test_close_on_collect'>, '__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 0xf4eb9a7c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...on_collect'>, '__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 0xf4e6c12c>
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 0xf4e6c12c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...on_collect'>, '__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': <AppTestFunction 'test_close_on_collect'>, '__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 0xf4eb9be4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...on_collect'>, '__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 0xf4e6c0cc>
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 0xf4e6c0cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...on_collect'>, '__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': <AppTestFunction 'test_close_on_collect'>, '__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 = <AppTestFunction 'test_close_on_collect'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_close_on_collect'>
def runtest(self):
target = self.w_obj
space = target.space
self.check_run(space, target)
> self.execute_appex(space, target)
tool/pytest/apptest2.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_close_on_collect'>, space = StdObjSpace
w_func = <Function test_close_on_collect>
def execute_appex(self, space, w_func):
space.getexecutioncontext().set_sys_exc_info(None)
sig = w_func.code._signature
if sig.varargname or sig.kwargname:
raise ValueError(
'Test functions may not use *args or **kwargs')
args_w = self.get_fixtures(space, sig.argnames)
try:
> space.call_function(w_func, *args_w)
tool/pytest/apptest2.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_close_on_collect>, args_w = ()
nargs = 0, 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_close_on_collect>, args_w = ()
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_close_on_collect, file '/build_dir/own-linux-x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213>
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_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223
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_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223
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_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223
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_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223
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_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223
pycode = <code object test_close_on_collect, file '/build_dir/own-linux-x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf554576c>
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_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00\x87\x00\x00f\x01\x00d\x02\x00\x86\x00\x00\x89\x00\x00\x88\x00\x00\x83\x00\x00}\x...x04\x00\xc9\x0b\x00|\x06\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x02\x00\x04}\x04\x00}\x03\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf554576c>
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_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00\x87\x00\x00f\x01\x00d\x02\x00\x86\x00\x00\x89\x00\x00\x88\x00\x00\x83\x00\x00}\x...x04\x00\xc9\x0b\x00|\x06\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x02\x00\x04}\x04\x00}\x03\x00d\x00\x00S'
next_instr = 55L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf554576c>
@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_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223
nameindex = 2, ignored = (55L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf56c1fec>
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 0xf56c1fec>
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 0xf56c1fec>
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
_______________________ TestTypeDef.test_subclass_cache ________________________
self = <pypy.interpreter.test.test_typedef.TestTypeDef instance at 0xf3d1802c>
def test_subclass_cache(self):
# check that we don't create more than 6 subclasses of a
# given W_XxxObject (instead of the 16 that follow from
# all combinations)
space = self.space
sources = []
for hasdict in [False, True]:
for wants_slots in [False, True]:
for needsdel in [False, True]:
for weakrefable in [False, True]:
print 'Testing case', hasdict, wants_slots,
print needsdel, weakrefable
slots = []
checks = []
if hasdict:
slots.append('__dict__')
checks.append('x.foo=5; x.__dict__')
else:
checks.append('raises(AttributeError, "x.foo=5");'
'raises(AttributeError, "x.__dict__")')
if wants_slots:
slots.append('a')
checks.append('x.a=5; assert X.a.__get__(x)==5')
else:
checks.append('')
if weakrefable:
slots.append('__weakref__')
checks.append('import _weakref;_weakref.ref(x)')
else:
checks.append('')
if needsdel:
methodname = '__del__'
checks.append('X();X();X();'
'import gc;gc.collect();'
'assert seen')
else:
methodname = 'spam'
checks.append('assert "Del" not in irepr')
assert len(checks) == 4
space.appexec([], """():
seen = []
class X(list):
__slots__ = %r
def %s(self):
seen.append(1)
x = X()
import __pypy__
irepr = __pypy__.internal_repr(x)
print irepr
%s
%s
%s
%s
""" % (slots, methodname, checks[0], checks[1],
> checks[2], checks[3]))
interpreter/test/test_typedef.py:128:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
interpreter/baseobjspace.py:1479: in appexec
return self.call_args(w_func, args)
objspace/descroperation.py:186: in call_args
return w_obj.call_args(args)
interpreter/function.py:68: in call_args
w_res = self.getcode().funcrun(self, args)
interpreter/pycode.py:223: in funcrun
return frame.run()
interpreter/pyframe.py:253: in run
return self.execute_frame()
interpreter/pyframe.py:290: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:943: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:286: in execute_frame
executioncontext)
interpreter/pyopcode.py:63: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:70: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:356: in dispatch_bytecode
self.LOOKUP_METHOD(oparg, next_instr)
objspace/std/callmethod.py:63: in LOOKUP_METHOD
w_value = w_obj.getdictvalue(space, name)
interpreter/mixedmodule.py:93: in getdictvalue
return self._load_lazily(space, name)
interpreter/mixedmodule.py:103: in _load_lazily
w_value = loader(space)
interpreter/mixedmodule.py:182: in ifileloader
d[name] = __import__(pkgroot+'.'+name, None, None, [name])
module/gc/interp_gc.py:4: in <module>
from pypy.module.gc.hook import W_GcCollectStepStats
module/gc/hook.py:2: in <module>
from rpython.memory.gc import incminimark
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"""
# 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
----------------------------- Captured stdout call -----------------------------
Testing case False False False False
Testing case False False False True
Testing case False False True False
________________________ AppTestTypeDef.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 0xf443bbfc>, 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 0xf7a40c6c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69f2f8c>]
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 0xf69f2f8c>]
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 0xf512e234>
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 0xf3d548cc>
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 0xf3d548cc>
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 0xf5377284>
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 0xf3d543ec>
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 0xf3d543ec>
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 0xf3cc7dbc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3d543ac>)
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 0xf3d543ac>,)
w_func = <Function test_destructor>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3d543ac>
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 0xf3d543ac>,)
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 0xf3d543ac>,)
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/interpreter/test/test_typedef.py:335]', 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...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12
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...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12
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...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12
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...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12
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...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12
pycode = <code object test_destructor, file '[/build_dir/own-linux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e27b4c>
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...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00g\x00\x00\x89\x01\x00d\x02\x00t\x02\x00f\x...00s\xbd\x00t\x08\x00\x82\x01\x00t\t\x00t\n\x00\x88\x00\x00j\x06\x00|\x04\x00d\t\x00d\x06\x00\x83\x05\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e27b4c>
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...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00g\x00\x00\x89\x01\x00d\x02\x00t\x02\x00f\x...00s\xbd\x00t\x08\x00\x82\x01\x00t\t\x00t\n\x00\x88\x00\x00j\x06\x00|\x04\x00d\t\x00d\x06\x00\x83\x05\x00\x01d\x00\x00S'
next_instr = 128L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e27b4c>
@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...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12
nameindex = 7, ignored = (128L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf48dee6c>
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 0xf48dee6c>
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 0xf48dee6c>
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
=========================== short test summary info ============================
FAIL interpreter/test/apptest_generator.py::test_close_on_collect
FAIL interpreter/test/test_typedef.py::TestTypeDef::()::test_subclass_cache
FAIL interpreter/test/test_typedef.py::AppTestTypeDef::()::test_destructor
============== 3 failed, 729 passed, 40 skipped in 398.50 seconds ==============
++ 08:31:29 starting module/_jitlog/test [16 started in total]
__ module/_jitlog/test [13 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/_jitlog/test/test__jitlog.py .
========================== 1 passed in 13.94 seconds ===========================
++ 08:31:46 starting module/_locale/test [17 started in total]
__ module/_locale/test [14 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 14 items
module/_locale/test/test_locale.py ssssssssssssss
========================= 14 skipped in 11.43 seconds ==========================
++ 08:32:01 starting module/_lsprof/test [18 started in total]
__ module/_lsprof/test [15 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/_lsprof/test/test_cprofile.py ......
========================== 6 passed in 14.48 seconds ===========================
++ 08:32:18 starting module/_md5/test [19 started in total]
__ module/_md5/test [16 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/_md5/test/test_md5.py .s....
===================== 5 passed, 1 skipped in 26.63 seconds =====================
++ 08:32:46 starting module/_minimal_curses/test [20 started in total]
__ module/_cppyy/test [17 done in total, somefailed=True] _____________________
[platform:WARNING] cc1plus: warning: command-line option ‘-Wno-discarded-qualifiers’ is valid for C/ObjC but not for C++
[platform:WARNING] cc1plus: warning: command-line option ‘-Wno-duplicate-decl-specifier’ is valid for C/ObjC but not for C++
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 191 items
module/_cppyy/test/test_advancedcpp.py sssssssssssssssssssssssss
module/_cppyy/test/test_boost.py sssss
module/_cppyy/test/test_cpp11features.py s.s
module/_cppyy/test/test_cppyy.py .....FFFFFF
module/_cppyy/test/test_crossing.py ssss
module/_cppyy/test/test_datatypes.py .......sssssssssssssss
module/_cppyy/test/test_fragile.py sssssssssssss
module/_cppyy/test/test_helper.py ......
module/_cppyy/test/test_operators.py sssssss
module/_cppyy/test/test_overloads.py sssssss
module/_cppyy/test/test_pythonify.py ..FFFsssssssssssss
module/_cppyy/test/test_pythonization.py .ssssss
module/_cppyy/test/test_regression.py ss
module/_cppyy/test/test_stltypes.py sssssssssssssssssssssssss
module/_cppyy/test/test_templates.py sssssssssssssssssssssssssssssssss
module/_cppyy/test/test_zjit.py sss
=================================== FAILURES ===================================
__________________________ AppTestCPPYY.test05_memory __________________________
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 0xf36a4f7c>, 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 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05_memory'>}
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 0xf7a8232c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf5a2344c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05_memory'>}
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 0xf5a2344c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05_memory'>}
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 'test05_memory'>, '__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 0xf3586af4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t05_memory'>, '__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 0xf31fcf6c>
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 0xf31fcf6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t05_memory'>, '__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 'test05_memory'>, '__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 0xf329e5f4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t05_memory'>, '__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 0xf39b41ec>
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 0xf39b41ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t05_memory'>, '__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 'test05_memory'>, '__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 'test05_memory'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test05_memory'>
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 'test05_memory'>, space = StdObjSpace
target = <function test05_memory at 0xf3176294>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>)
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 0xf33c63ec>,)
w_func = <Function test05_memory>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>
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 test05_memory>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>,)
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 test05_memory>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>,)
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 test05_memory, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', 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 test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18
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 test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18
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 test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18
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 test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18
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 test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18
pycode = <code object test05_memory, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3dac4ec>
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 test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00j\x02\x00}\x03\x00\xcc\x1e\x00|\x03\...1e\x00|\x03\x00\xc9\x03\x00d\x03\x00\xca\x01\x00\x83\x00\x00d\x04\x00k\x02\x00s\xd2\x01t\x04\x00\x82\x01\x00d\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3dac4ec>
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 test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00j\x02\x00}\x03\x00\xcc\x1e\x00|\x03\...1e\x00|\x03\x00\xc9\x03\x00d\x03\x00\xca\x01\x00\x83\x00\x00d\x04\x00k\x02\x00s\xd2\x01t\x04\x00\x82\x01\x00d\x02\x00S'
next_instr = 219L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3dac4ec>
@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 test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18
nameindex = 6, ignored = (219L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4810bec>
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 0xf4810bec>
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 0xf4810bec>
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
_________________________ AppTestCPPYY.test05a_memory2 _________________________
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 0xf325787c>, 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 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05a_memory2'>}
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 0xf7a8232c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf5a2344c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05a_memory2'>}
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 0xf5a2344c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05a_memory2'>}
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 'test05a_memory2'>, '__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 0xf3032874>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...5a_memory2'>, '__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 0xf30f72ac>
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 0xf30f72ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...5a_memory2'>, '__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 'test05a_memory2'>, '__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 0xf303252c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...5a_memory2'>, '__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 0xf30f734c>
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 0xf30f734c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...5a_memory2'>, '__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 'test05a_memory2'>, '__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 'test05a_memory2'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test05a_memory2'>
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 'test05a_memory2'>, space = StdObjSpace
target = <function test05a_memory2 at 0xf2d50dbc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>)
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 0xf33c63ec>,)
w_func = <Function test05a_memory2>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>
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 test05a_memory2>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>,)
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 test05a_memory2>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>,)
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 test05a_memory2, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', 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 test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15
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 test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15
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 test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15
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 test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15
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 test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15
pycode = <code object test05a_memory2, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3dac4ec>
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 test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00j\x02\x00}\x03\x00\xcc\x1e\x00|\x03\...00k\x02\x00s\xc7\x00t\x04\x00\x82\x01\x00|\x03\x00\xc9\x03\x00d\x07\x00\xca\x01\x00d\x04\x00\x83\x01\x00\x01d\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3dac4ec>
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 test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00j\x02\x00}\x03\x00\xcc\x1e\x00|\x03\...00k\x02\x00s\xc7\x00t\x04\x00\x82\x01\x00|\x03\x00\xc9\x03\x00d\x07\x00\xca\x01\x00d\x04\x00\x83\x01\x00\x01d\x02\x00S'
next_instr = 162L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3dac4ec>
@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 test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15
nameindex = 9, ignored = (162L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4810bec>
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 0xf4810bec>
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 0xf4810bec>
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
______________________ AppTestCPPYY.test06_method_double _______________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>
def test06_method_double(self):
"""Test passing of a double and returning of double on a method."""
import _cppyy
t = self.example01
e = self.instantiate(t, 13)
res = t.get_overload("addDataToDouble")(e, 16)
assert round(res-29, 8) == 0.
e.__destruct__()
e = self.instantiate(t, -13)
res = t.get_overload("addDataToDouble")(e, 16)
assert round(res-3, 8) == 0.
e.__destruct__()
> assert t.get_overload("getCount")() == 0
E (application-level) AssertionError: assert 1 == 0
E + where 1 = <CPPStaticOverload object at 0xf32f02cc>()
E + where <CPPStaticOverload object at 0xf32f02cc> = <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf356c7cc>>('getCount')
E + where <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf356c7cc>> = <CPPClassDecl object at 0xf356c7cc>.get_overload
[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:182]:17: AssertionError
____________________ AppTestCPPYY.test07_method_constcharp _____________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>
def test07_method_constcharp(self):
"""Test passing of a C string and returning of a C string on a
method."""
import _cppyy
t = self.example01
e = self.instantiate(t, 42)
res = t.get_overload("addDataToAtoi")(e, "13")
assert res == 55
res = t.get_overload("addToStringValue")(e, "12") # TODO: this leaks
assert res == "54"
res = t.get_overload("addToStringValue")(e, "-12") # TODO: this leaks
assert res == "30"
e.__destruct__()
> assert t.get_overload("getCount")() == 0
E (application-level) AssertionError: assert 1 == 0
E + where 1 = <CPPStaticOverload object at 0xf32f02cc>()
E + where <CPPStaticOverload object at 0xf32f02cc> = <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf356c7cc>>('getCount')
E + where <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf356c7cc>> = <CPPClassDecl object at 0xf356c7cc>.get_overload
[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:200]:16: AssertionError
__________________ AppTestCPPYY.test08_pass_object_by_pointer __________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>
def test08_pass_object_by_pointer(self):
"""Test passing of an instance as an argument."""
import _cppyy
t1 = self.example01
t2 = self.payload
pl = self.instantiate(t2, 3.14)
assert round(t2.get_overload("getData")(pl)-3.14, 8) == 0
t1.get_overload("staticSetPayload")(pl, 41.)
assert t2.get_overload("getData")(pl) == 41.
e = self.instantiate(t1, 50)
t1.get_overload("setPayload")(e, pl);
assert round(t2.get_overload("getData")(pl)-50., 8) == 0
e.__destruct__()
pl.__destruct__()
> assert t1.get_overload("getCount")() == 0
E (application-level) AssertionError: assert 1 == 0
E + where 1 = <CPPStaticOverload object at 0xf32f02cc>()
E + where <CPPStaticOverload object at 0xf32f02cc> = <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf356c7cc>>('getCount')
E + where <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf356c7cc>> = <CPPClassDecl object at 0xf356c7cc>.get_overload
[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:217]:19: AssertionError
_________________ AppTestCPPYY.test09_return_object_by_pointer _________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf33c63ec>
def test09_return_object_by_pointer(self):
"""Test returning of an instance as an argument."""
import _cppyy
t1 = self.example01
t2 = self.payload
pl1 = self.instantiate(t2, 3.14)
assert round(t2.get_overload("getData")(pl1)-3.14, 8) == 0
pl2 = t1.get_overload("staticCyclePayload")(pl1, 38.)
assert t2.get_overload("getData")(pl2) == 38.
e = self.instantiate(t1, 50)
pl2 = t1.get_overload("cyclePayload")(e, pl1);
assert round(t2.get_overload("getData")(pl2)-50., 8) == 0
e.__destruct__()
pl1.__destruct__()
> assert t1.get_overload("getCount")() == 0
E (application-level) AssertionError: assert 1 == 0
E + where 1 = <CPPStaticOverload object at 0xf32f02cc>()
E + where <CPPStaticOverload object at 0xf32f02cc> = <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf356c7cc>>('getCount')
E + where <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf356c7cc>> = <CPPClassDecl object at 0xf356c7cc>.get_overload
[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:237]:19: AssertionError
_______________ AppTestPYTHONIFY.test03_constructing_and_calling _______________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf1df734c>
def test03_constructing_and_calling(self):
"""Test object and method calls."""
import _cppyy
example01_class = _cppyy.gbl.example01
> assert example01_class.getCount() == 0
E (application-level) AssertionError: assert 1 == 0
E + where 1 = <CPPStaticOverload object at 0xf32f02cc>()
E + where <CPPStaticOverload object at 0xf32f02cc> = <CPPStaticOverload object at 0xf32f02cc>
E + where <CPPStaticOverload object at 0xf32f02cc> = <class 'cppyy.gbl.example01'>.getCount
[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_pythonify.py:68]:5: AssertionError
______________ AppTestPYTHONIFY.test04_passing_object_by_pointer _______________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf1df734c>
def test04_passing_object_by_pointer(self):
import _cppyy
example01_class = _cppyy.gbl.example01
payload_class = _cppyy.gbl.payload
e = example01_class(14)
pl = payload_class(3.14)
assert round(pl.getData()-3.14, 8) == 0
example01_class.staticSetPayload(pl, 41.)
assert pl.getData() == 41.
example01_class.staticSetPayload(pl, 43.)
assert pl.getData() == 43.
e.staticSetPayload(pl, 45.)
assert pl.getData() == 45.
e.setPayload(pl)
assert round(pl.getData()-14., 8) == 0
pl.__destruct__()
e.__destruct__()
> assert example01_class.getCount() == 0
E (application-level) AssertionError: assert 1 == 0
E + where 1 = <CPPStaticOverload object at 0xf32f02cc>()
E + where <CPPStaticOverload object at 0xf32f02cc> = <CPPStaticOverload object at 0xf32f02cc>
E + where <CPPStaticOverload object at 0xf32f02cc> = <class 'cppyy.gbl.example01'>.getCount
[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_pythonify.py:117]:22: AssertionError
_____________ AppTestPYTHONIFY.test05_returning_object_by_pointer ______________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf1df734c>
def test05_returning_object_by_pointer(self):
import _cppyy
example01_class = _cppyy.gbl.example01
payload_class = _cppyy.gbl.payload
pl = payload_class(3.14)
assert round(pl.getData()-3.14, 8) == 0
pl2 = example01_class.staticCyclePayload(pl, 38.)
assert pl2.getData() == 38.
e = example01_class(14)
pl2 = e.cyclePayload(pl)
assert round(pl2.getData()-14., 8) == 0
pl.__destruct__()
e.__destruct__()
> assert example01_class.getCount() == 0
E (application-level) AssertionError: assert 1 == 0
E + where 1 = <CPPStaticOverload object at 0xf32f02cc>()
E + where <CPPStaticOverload object at 0xf32f02cc> = <CPPStaticOverload object at 0xf32f02cc>
E + where <CPPStaticOverload object at 0xf32f02cc> = <class 'cppyy.gbl.example01'>.getCount
[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_pythonify.py:140]:19: AssertionError
=========================== short test summary info ============================
FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test05_memory
FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test05a_memory2
FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test06_method_double
FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test07_method_constcharp
FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test08_pass_object_by_pointer
FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test09_return_object_by_pointer
FAIL module/_cppyy/test/test_pythonify.py::AppTestPYTHONIFY::()::test03_constructing_and_calling
FAIL module/_cppyy/test/test_pythonify.py::AppTestPYTHONIFY::()::test04_passing_object_by_pointer
FAIL module/_cppyy/test/test_pythonify.py::AppTestPYTHONIFY::()::test05_returning_object_by_pointer
============== 9 failed, 22 passed, 160 skipped in 208.50 seconds ==============
++ 08:33:28 starting module/_multibytecodec/test [21 started in total]
__ module/_minimal_curses/test [18 done in total, somefailed=False] ___________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/_minimal_curses/test/test_curses.py sss...
===================== 3 passed, 3 skipped in 39.62 seconds =====================
++ 08:33:30 starting module/_multiprocessing/test [22 started in total]
__ module/_multibytecodec/test [19 done in total, somefailed=False] ___________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 51 items
module/_multibytecodec/test/test_app_codecs.py ................
module/_multibytecodec/test/test_app_incremental.py ............
module/_multibytecodec/test/test_app_stream.py .....
module/_multibytecodec/test/test_c_codecs.py ................s
module/_multibytecodec/test/test_translation.py .
==================== 50 passed, 1 skipped in 64.79 seconds =====================
++ 08:34:40 starting module/_pypyjson/test [23 started in total]
__ module/_pypyjson/test [20 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 42 items / 1 skipped
module/_pypyjson/test/test__pypyjson.py ..........................................
==================== 42 passed, 1 skipped in 18.84 seconds =====================
++ 08:35:01 starting module/_random/test [24 started in total]
__ module/_random/test [21 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 14 items
module/_random/test/test_random.py .............
module/_random/test/test_ztranslation.py .
========================== 14 passed in 36.55 seconds ==========================
++ 08:35:39 starting module/_rawffi/alt/test [25 started in total]
__ module/_rawffi/alt/test [22 done in total, somefailed=False] _______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 73 items
module/_rawffi/alt/test/test_ffitype.py .....
module/_rawffi/alt/test/test_funcptr.py ..................................ssssss.s
module/_rawffi/alt/test/test_struct.py ...............
module/_rawffi/alt/test/test_type_converter.py ...........
==================== 66 passed, 7 skipped in 24.41 seconds =====================
++ 08:36:07 starting module/_rawffi/test [26 started in total]
__ module/_rawffi/test [23 done in total, somefailed=True] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 83 items
module/_rawffi/test/apptest_rawffi.py .
module/_rawffi/test/test__rawffi.py .....s.............................................s..........s..n: 2
Arg 0: 3
Arg 1: 15
.FF
module/_rawffi/test/test_exit.py .
module/_rawffi/test/test_nested.py ......
module/_rawffi/test/test_struct.py ...
module/_rawffi/test/test_tracker.py ...
module/_rawffi/test/test_ztranslation.py .
=================================== FAILURES ===================================
___________________ AppTestAutoFree.test_structure_autofree ____________________
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 0xf4a385dc>, 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_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_structure_autofree'>}
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 0xf7a5e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69fb4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_structure_autofree'>}
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 0xf69fb4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_structure_autofree'>}
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_structure_autofree'>, '__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 0xf4a1075c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...e_autofree'>, '__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 0xf4a1108c>
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 0xf4a1108c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...e_autofree'>, '__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_structure_autofree'>, '__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 0xf4a10c34>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...e_autofree'>, '__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 0xf4a117ac>
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 0xf4a117ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...e_autofree'>, '__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_structure_autofree'>, '__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_structure_autofree'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_structure_autofree'>
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_structure_autofree'>, space = StdObjSpace
target = <function test_structure_autofree at 0xf4a0902c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a908ac>)
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 0xf4a908ac>,)
w_func = <Function test_structure_autofree>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a908ac>
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_structure_autofree>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a908ac>,)
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_structure_autofree>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a908ac>,)
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_structure_autofree, file '[/build_dir/own-linux-x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', 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_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3
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_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3
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_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3
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_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3
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_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3
pycode = <code object test_structure_autofree, file '[/build_dir/own-linux-x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf506ac8c>
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_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00\xca\x00\x00\x01|\x01\x0...ba\x00\xcc\x18\x00|\x04\x00|\x02\x00\xc9\x04\x00\xca\x00\x00k\x02\x00s\xb7\x00t\x08\x00\x82\x01\x00n\x00\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf506ac8c>
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_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00\xca\x00\x00\x01|\x01\x0...ba\x00\xcc\x18\x00|\x04\x00|\x02\x00\xc9\x04\x00\xca\x00\x00k\x02\x00s\xb7\x00t\x08\x00\x82\x01\x00n\x00\x00d\x00\x00S'
next_instr = 30L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf506ac8c>
@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_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3
nameindex = 2, ignored = (30L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf5086e2c>
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 0xf5086e2c>
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 0xf5086e2c>
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
_____________________ AppTestAutoFree.test_array_autofree ______________________
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 0xf49ffdbc>, 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_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_array_autofree'>}
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 0xf7a5e32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69fb4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_array_autofree'>}
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 0xf69fb4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_array_autofree'>}
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_array_autofree'>, '__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 0xf490ed9c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...y_autofree'>, '__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 0xf48de96c>
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 0xf48de96c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...y_autofree'>, '__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_array_autofree'>, '__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 0xf490ecd4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...y_autofree'>, '__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 0xf48de9ac>
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 0xf48de9ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...y_autofree'>, '__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_array_autofree'>, '__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_array_autofree'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_array_autofree'>
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_array_autofree'>, space = StdObjSpace
target = <function test_array_autofree at 0xf4970b54>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a908ac>)
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 0xf4a908ac>,)
w_func = <Function test_array_autofree>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a908ac>
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_array_autofree>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a908ac>,)
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_array_autofree>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a908ac>,)
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_array_autofree, file '[/build_dir/own-linux-x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', 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_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3
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_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3
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_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3
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_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3
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_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3
pycode = <code object test_array_autofree, file '[/build_dir/own-linux-x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf506ac8c>
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_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00\xca\x00\x00\x01y\x10\x0...\xcb\x00\xcc\x18\x00|\x03\x00|\x02\x00\xc9\x03\x00\xca\x00\x00k\x02\x00s\xc8\x00t\t\x00\x82\x01\x00n\x00\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf506ac8c>
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_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00\xca\x00\x00\x01y\x10\x0...\xcb\x00\xcc\x18\x00|\x03\x00|\x02\x00\xc9\x03\x00\xca\x00\x00k\x02\x00s\xc8\x00t\t\x00\x82\x01\x00n\x00\x00d\x00\x00S'
next_instr = 30L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf506ac8c>
@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_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3
nameindex = 2, ignored = (30L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf5086e2c>
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 0xf5086e2c>
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 0xf5086e2c>
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
=========================== short test summary info ============================
FAIL module/_rawffi/test/test__rawffi.py::AppTestAutoFree::()::test_structure_autofree
FAIL module/_rawffi/test/test__rawffi.py::AppTestAutoFree::()::test_array_autofree
=============== 2 failed, 78 passed, 3 skipped in 111.85 seconds ===============
++ 08:38:03 starting module/_sha/test [27 started in total]
__ module/_io/test [24 done in total, somefailed=True] ________________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 200 items
module/_io/test/apptest_bytesio.py ...FF.......
module/_io/test/apptest_io.py ........F.......................
module/_io/test/apptest_stringio.py .........................
module/_io/test/apptest_textio.py .............F.............
module/_io/test/test_bufferedio.py .......................................................F......................
module/_io/test/test_fileio.py ......................
module/_io/test/test_interp_textio.py ....
=================================== FAILURES ===================================
__________________________________ test_write __________________________________
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 0xf7a984c4>, 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': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_write'>}
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 0xf7a7032c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a0d4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_write'>}
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 0xf6a0d4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_write'>}
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': <AppTestFunction 'test_write'>, '__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 0xf5078d4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_write'>, '__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 0xf4e403cc>
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 0xf4e403cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_write'>, '__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': <AppTestFunction 'test_write'>, '__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 0xf4de261c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_write'>, '__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 0xf4e406cc>
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 0xf4e406cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_write'>, '__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': <AppTestFunction 'test_write'>, '__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 = <AppTestFunction 'test_write'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_write'>
def runtest(self):
target = self.w_obj
space = target.space
self.check_run(space, target)
> self.execute_appex(space, target)
tool/pytest/apptest2.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_write'>, space = StdObjSpace
w_func = <Function test_write>
def execute_appex(self, space, w_func):
space.getexecutioncontext().set_sys_exc_info(None)
sig = w_func.code._signature
if sig.varargname or sig.kwargname:
raise ValueError(
'Test functions may not use *args or **kwargs')
args_w = self.get_fixtures(space, sig.argnames)
try:
> space.call_function(w_func, *args_w)
tool/pytest/apptest2.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_write>, args_w = (), nargs = 0
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_write>, args_w = ()
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_write, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32>
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_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38
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_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38
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_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38
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_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38
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_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38
pycode = <code object test_write, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51ead2c>
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_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38
co_code = 't\x00\x00\xc9\x01\x00\xca\x00\x00}\x00\x00|\x00\x00j\x02\x00}\x01\x00d\x01\x00}\x02\x00|\x01\x00|\x02\x00\x83\x01\x00...00\x82\x01\x00d\x00\x00\x04}\x01\x00\x04}\x02\x00\x04}\x03\x00}\x0b\x00|\x00\x00\xc9\x12\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51ead2c>
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_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38
co_code = 't\x00\x00\xc9\x01\x00\xca\x00\x00}\x00\x00|\x00\x00j\x02\x00}\x01\x00d\x01\x00}\x02\x00|\x01\x00|\x02\x00\x83\x01\x00...00\x82\x01\x00d\x00\x00\x04}\x01\x00\x04}\x02\x00\x04}\x03\x00}\x0b\x00|\x00\x00\xc9\x12\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 881L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51ead2c>
@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_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38
nameindex = 16, ignored = (881L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf5312c8c>
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 0xf5312c8c>
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 0xf5312c8c>
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
__________________________________ test_read ___________________________________
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 0xf4c4b224>, 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': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_read'>}
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 0xf7a7032c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a0d4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_read'>}
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 0xf6a0d4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_read'>}
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': <AppTestFunction 'test_read'>, '__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 0xf4d3adec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_read'>, '__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 0xf48d54ac>
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 0xf48d54ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_read'>, '__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': <AppTestFunction 'test_read'>, '__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 0xf4d3ad4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_read'>, '__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 0xf48d530c>
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 0xf48d530c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_read'>, '__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': <AppTestFunction 'test_read'>, '__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 = <AppTestFunction 'test_read'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_read'>
def runtest(self):
target = self.w_obj
space = target.space
self.check_run(space, target)
> self.execute_appex(space, target)
tool/pytest/apptest2.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_read'>, space = StdObjSpace
w_func = <Function test_read>
def execute_appex(self, space, w_func):
space.getexecutioncontext().set_sys_exc_info(None)
sig = w_func.code._signature
if sig.varargname or sig.kwargname:
raise ValueError(
'Test functions may not use *args or **kwargs')
args_w = self.get_fixtures(space, sig.argnames)
try:
> space.call_function(w_func, *args_w)
tool/pytest/apptest2.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_read>, args_w = (), nargs = 0
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_read>, args_w = ()
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_read, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42>
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_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45
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_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45
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_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45
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_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45
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_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45
pycode = <code object test_read, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51ead2c>
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_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45
co_code = 't\x00\x00\xc9\x01\x00d\x01\x00\xca\x01\x00}\x00\x00|\x00\x00j\x02\x00}\x01\x00|\x01\x00\x83\x00\x00}\x02\x00d\x01\x00...1\x00d\x00\x00\x04}\x01\x00\x04}\x02\x00\x04}\x04\x00\x04}\t\x00}\x08\x00|\x00\x00\xc9\r\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51ead2c>
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_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45
co_code = 't\x00\x00\xc9\x01\x00d\x01\x00\xca\x01\x00}\x00\x00|\x00\x00j\x02\x00}\x01\x00|\x01\x00\x83\x00\x00}\x02\x00d\x01\x00...1\x00d\x00\x00\x04}\x01\x00\x04}\x02\x00\x04}\x04\x00\x04}\t\x00}\x08\x00|\x00\x00\xc9\r\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 271L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51ead2c>
@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_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45
nameindex = 12, ignored = (271L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf5312c8c>
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 0xf5312c8c>
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 0xf5312c8c>
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
_______________________________ 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 0xf4d1ded4>, 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': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction '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 0xf7a7032c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a0d4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction '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 0xf6a0d4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction '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': <AppTestFunction '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 0xf4b78e3c>
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 0xf4a2492c>
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 0xf4a2492c>
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': <AppTestFunction '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 0xf47d0e14>
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 0xf4a2498c>
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 0xf4a2498c>
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': <AppTestFunction '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 = <AppTestFunction 'test_destructor'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_destructor'>
def runtest(self):
target = self.w_obj
space = target.space
self.check_run(space, target)
> self.execute_appex(space, target)
tool/pytest/apptest2.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_destructor'>, space = StdObjSpace
w_func = <Function test_destructor>
def execute_appex(self, space, w_func):
space.getexecutioncontext().set_sys_exc_info(None)
sig = w_func.code._signature
if sig.varargname or sig.kwargname:
raise ValueError(
'Test functions may not use *args or **kwargs')
args_w = self.get_fixtures(space, sig.argnames)
try:
> space.call_function(w_func, *args_w)
tool/pytest/apptest2.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_destructor>, args_w = (), nargs = 0
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 = ()
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/apptest_io.py', line 93>
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...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108
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...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108
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...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108
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...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108
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...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108
pycode = <code object test_destructor, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50e2c6c>
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...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\x01g\x00\x00\x89\x01\x00d\x02\x00|\x00\x00j\x01...\x00t\n\x00t\x04\x00\xc9\x0b\x00|\x05\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x03\x00}\x02\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50e2c6c>
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...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\x01g\x00\x00\x89\x01\x00d\x02\x00|\x00\x00j\x01...\x00t\n\x00t\x04\x00\xc9\x0b\x00|\x05\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x03\x00}\x02\x00d\x00\x00S'
next_instr = 87L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50e2c6c>
@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...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108
nameindex = 3, ignored = (87L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf512548c>
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 0xf512548c>
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 0xf512548c>
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
_______________________________ 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 0xf40e856c>, 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': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction '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 0xf7a7032c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a0d4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction '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 0xf6a0d4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction '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': <AppTestFunction '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 0xf45737ac>
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 0xf3d5766c>
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 0xf3d5766c>
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': <AppTestFunction '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 0xf4b1caa4>
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 0xf3d5748c>
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 0xf3d5748c>
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': <AppTestFunction '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 = <AppTestFunction 'test_destructor'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_destructor'>
def runtest(self):
target = self.w_obj
space = target.space
self.check_run(space, target)
> self.execute_appex(space, target)
tool/pytest/apptest2.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_destructor'>, space = StdObjSpace
w_func = <Function test_destructor>
def execute_appex(self, space, w_func):
space.getexecutioncontext().set_sys_exc_info(None)
sig = w_func.code._signature
if sig.varargname or sig.kwargname:
raise ValueError(
'Test functions may not use *args or **kwargs')
args_w = self.get_fixtures(space, sig.argnames)
try:
> space.call_function(w_func, *args_w)
tool/pytest/apptest2.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_destructor>, args_w = (), nargs = 0
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 = ()
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/apptest_textio.py', line 140>
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...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150
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...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150
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...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150
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...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150
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...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150
pycode = <code object test_destructor, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5166d2c>
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...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150
co_code = 'g\x00\x00\x89\x00\x00d\x01\x00t\x00\x00j\x01\x00f\x01\x00\x87\x00\x00f\x01\x00d\x02\x00\x86\x00\x00\x83\x00\x00Y}\x00...\x00t\x0c\x00t\x06\x00\xc9\r\x00|\x07\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x05\x00}\x04\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5166d2c>
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...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150
co_code = 'g\x00\x00\x89\x00\x00d\x01\x00t\x00\x00j\x01\x00f\x01\x00\x87\x00\x00f\x01\x00d\x02\x00\x86\x00\x00\x83\x00\x00Y}\x00...\x00t\x0c\x00t\x06\x00\xc9\r\x00|\x07\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x05\x00}\x04\x00d\x00\x00S'
next_instr = 101L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5166d2c>
@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...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150
nameindex = 5, ignored = (101L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4f37f4c>
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 0xf4f37f4c>
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 0xf4f37f4c>
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
____________________ 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 0xf29b00d4>, 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 0xf7a7032c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a0d4cc>]
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 0xf6a0d4cc>]
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 0xf3052cd4>
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 0xf1906f8c>
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 0xf1906f8c>
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 0xf337575c>
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 0xf19064ec>
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 0xf19064ec>
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 0xf18813ac>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf1b9e82c>)
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 0xf1b9e82c>,)
w_func = <Function test_destructor>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf1b9e82c>
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 0xf1b9e82c>,)
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 0xf1b9e82c>,)
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 0xf380d12c>
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 0xf380d12c>
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 0xf380d12c>
@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 0xf38569ec>
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 0xf38569ec>
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 0xf38569ec>
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
=========================== short test summary info ============================
FAIL module/_io/test/apptest_bytesio.py::test_write
FAIL module/_io/test/apptest_bytesio.py::test_read
FAIL module/_io/test/apptest_io.py::test_destructor
FAIL module/_io/test/apptest_textio.py::test_destructor
FAIL module/_io/test/test_bufferedio.py::AppTestBufferedWriter::()::test_destructor
==================== 5 failed, 195 passed in 397.71 seconds ====================
++ 08:38:09 starting module/_socket/test [28 started in total]
__ module/_sha/test [25 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/_sha/test/test_sha.py .s....
===================== 5 passed, 1 skipped in 25.40 seconds =====================
++ 08:38:31 starting module/_sre/test [29 started in total]
__ module/_multiprocessing/test [26 done in total, somefailed=False] __________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 24 items
module/_multiprocessing/test/test_connection.py ..sss......
module/_multiprocessing/test/test_interp_semaphore.py .
module/_multiprocessing/test/test_memory.py ..
module/_multiprocessing/test/test_semaphore.py .......
module/_multiprocessing/test/test_win32.py ss
module/_multiprocessing/test/test_ztranslation.py .
==================== 19 passed, 5 skipped in 335.79 seconds ====================
++ 08:39:10 starting module/_vmprof/test [30 started in total]
__ module/_vmprof/test [27 done in total, somefailed=True] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 7 items
module/_vmprof/test/test__vmprof.py F....
module/_vmprof/test/test_direct.py ..
=================================== FAILURES ===================================
_______________________ AppTestVMProf.test_import_vmprof _______________________
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 0xf5a1009c>, 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_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_import_vmprof'>}
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 0xf7a5c32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69f86cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_import_vmprof'>}
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 0xf69f86cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_import_vmprof'>}
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_import_vmprof'>, '__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 0xf4f871e4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ort_vmprof'>, '__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 0xf5044bac>
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 0xf5044bac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ort_vmprof'>, '__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_import_vmprof'>, '__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 0xf4f87194>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ort_vmprof'>, '__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 0xf504492c>
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 0xf504492c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ort_vmprof'>, '__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_import_vmprof'>, '__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_import_vmprof'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_import_vmprof'>
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_import_vmprof'>, space = StdObjSpace
target = <function test_import_vmprof at 0xf4fc5924>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4fbb6cc>)
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 0xf4fbb6cc>,)
w_func = <Function test_import_vmprof>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4fbb6cc>
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_import_vmprof>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4fbb6cc>,)
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_import_vmprof>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4fbb6cc>,)
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_import_vmprof, file '[/build_dir/own-linux-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', 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_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
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_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
w_inputvalue = None, operr = None
def execute_frame(self, w_inputvalue=None, operr=None):
# indirection for the optional arguments
> return my_execute_frame(self, w_inputvalue, operr)
module/_vmprof/interp_vmprof.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51, None, None)
unique_id = 180, x = <* DEAD Struct vmprof_stack_s { c_next, c_value, c_kind }>
def decorated_function(*args):
unique_id = get_code_fn(*args)._vmprof_unique_id
unique_id = rffi.cast(lltype.Signed, unique_id)
# ^^^ removes the "known non-negative" hint for annotation
#
# Signals can occur at the two places (1) and (2), that will
# have added a stack entry, but the function __vmprof_eval_vmprof
# is not entered. This behaviour will swallow one Python stack frame
#
# Current fix: vmprof will discard this sample. (happens
# very infrequently)
#
if not jit.we_are_jitted():
x = enter_code(unique_id)
# (1) signal here
try:
> return func(*args)
../rpython/rlib/rvmprof/rvmprof.py:240:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
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_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
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_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
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_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
pycode = <code object test_import_vmprof, file '[/build_dir/own-linux-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4fbf44c>
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_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
co_code = 'e\x00\x00|\x00\x00j\x01\x00d\x01\x00\x83\x02\x00}\x01\x00|\x01\x00\xc9\x02\x00\xca\x00\x00}\x02\x00e\x00\x00|\x00\x00...\x00s\x9e\x01t\r\x00\x82\x01\x00\xcc\x16\x00|\x0c\x00|\n\x00d\r\x00\x17k\x05\x00s\xb7\x01t\r\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4fbf44c>
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_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
co_code = 'e\x00\x00|\x00\x00j\x01\x00d\x01\x00\x83\x02\x00}\x01\x00|\x01\x00\xc9\x02\x00\xca\x00\x00}\x02\x00e\x00\x00|\x00\x00...\x00s\x9e\x01t\r\x00\x82\x01\x00\xcc\x16\x00|\x0c\x00|\n\x00d\r\x00\x17k\x05\x00s\xb7\x01t\r\x00\x82\x01\x00d\x00\x00S'
next_instr = 147L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4fbf44c>
@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_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51
nameindex = 9, ignored = (147L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf51d22ac>
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 0xf51d22ac>
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 0xf51d22ac>
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
=========================== short test summary info ============================
FAIL module/_vmprof/test/test__vmprof.py::AppTestVMProf::()::test_import_vmprof
===================== 1 failed, 6 passed in 47.82 seconds ======================
++ 08:40:01 starting module/_warnings/test [31 started in total]
__ module/_file/test [28 done in total, somefailed=True] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 269 items
module/_file/test/test_file.py .................FF......sss......
module/_file/test/test_file_extra.py ..................................................................................................................................................................ss..............ss..............ss..............ss.....................
module/_file/test/test_large_file.py .s
=================================== FAILURES ===================================
_____________________ AppTestFile.test_exception_from_del ______________________
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 0xf4ff4fb4>, 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_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_exception_from_del'>}
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 0xf7a4632c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69e34cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_exception_from_del'>}
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 0xf69e34cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_exception_from_del'>}
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_exception_from_del'>, '__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 0xf4d03b6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...n_from_del'>, '__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 0xf4c5e48c>
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 0xf4c5e48c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...n_from_del'>, '__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_exception_from_del'>, '__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 0xf4ffeb94>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...n_from_del'>, '__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 0xf4c5e50c>
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 0xf4c5e50c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...n_from_del'>, '__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_exception_from_del'>, '__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_exception_from_del'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_exception_from_del'>
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_exception_from_del'>, space = StdObjSpace
target = <function test_exception_from_del at 0xf4c4fc34>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>)
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 0xf5131c8c>,)
w_func = <Function test_exception_from_del>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>
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_exception_from_del>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>,)
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_exception_from_del>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>,)
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_exception_from_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:255]', 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_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10
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_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10
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_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10
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_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10
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_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10
pycode = <code object test_exception_from_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
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_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00d\x01\x00...00\x00j\x05\x00\x83\x01\x00|\x06\x00\xc9\x0e\x00\xca\x00\x00k\x06\x00s\xfa\x00t\x0f\x00\x82\x01\x00n\x00\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
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_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00d\x01\x00...00\x00j\x05\x00\x83\x01\x00|\x06\x00\xc9\x0e\x00\xca\x00\x00k\x06\x00s\xfa\x00t\x0f\x00\x82\x01\x00n\x00\x00d\x00\x00S'
next_instr = 130L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
@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_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10
nameindex = 10, ignored = (130L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf525fa8c>
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 0xf525fa8c>
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 0xf525fa8c>
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
_______________________ AppTestFile.test_track_resources _______________________
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 0xf4cc380c>, 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_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>}
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 0xf7a4632c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69e34cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>}
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 0xf69e34cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>}
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_track_resources'>, '__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 0xf4ad48c4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__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 0xf4d3dbec>
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 0xf4d3dbec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__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_track_resources'>, '__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 0xf4ad4414>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__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 0xf4d3db0c>
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 0xf4d3db0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__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_track_resources'>, '__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_track_resources'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_track_resources'>
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_track_resources'>, space = StdObjSpace
target = <function test_track_resources at 0xf47f7df4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>)
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 0xf5131c8c>,)
w_func = <Function test_track_resources>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>
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_track_resources>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>,)
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_track_resources>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>,)
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_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', 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()
elif nargs >= 1 and fast_natural_arity == Code.PASSTHROUGHARGS1:
assert isinstance(code, gateway.BuiltinCodePassThroughArguments1)
return code.funcrun_obj(self, args_w[0],
Arguments(self.space,
list(args_w[1:])))
> return self.call_args(Arguments(self.space, list(args_w)))
interpreter/function.py:124:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_track_resources>
args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter/function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object test_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1>
func = <Function test_track_resources>
args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5131c8c>])
def funcrun(self, func, args):
frame = self.space.createframe(self, func.w_func_globals,
func)
sig = self._signature
# speed hack
fresh_frame = jit.hint(frame, access_directly=True,
fresh_virtualizable=True)
args.parse_into_scope(None, fresh_frame.locals_cells_stack_w, func.name,
sig, func.defs_w)
fresh_frame.init_cells()
> return frame.run()
interpreter/pycode.py:223:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
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_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
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_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
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_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
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_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
pycode = <code object test_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
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_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x01\x00d\x01\x00d\x00\x00l\x02\x00\x89\x03\x00d\x...xca\x02\x00s\xfd\x00t\x07\x00\x82\x01\x00\xcc\x12\x00d\t\x00|\x03\x00k\x07\x00s\x12\x01t\x07\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
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_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x01\x00d\x01\x00d\x00\x00l\x02\x00\x89\x03\x00d\x...xca\x02\x00s\xfd\x00t\x07\x00\x82\x01\x00\xcc\x12\x00d\t\x00|\x03\x00k\x07\x00s\x12\x01t\x07\x00\x82\x01\x00d\x00\x00S'
next_instr = 118L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
@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)
interpreter/pyopcode.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
oparg = 2, next_instr = 118L
def CALL_FUNCTION(self, oparg, next_instr):
# XXX start of hack for performance
if (oparg >> 8) & 0xff == 0:
# Only positional arguments
nargs = oparg & 0xff
w_function = self.peekvalue(nargs)
> w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/pyopcode.py:1233:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function fn>, nargs = 2
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
dropvalues = 3, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function fn>, nargs = 2
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
dropvalues = 3, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
return self._flat_pycall(code, nargs, frame, dropvalues)
elif fast_natural_arity & Code.FLATPYCALL:
natural_arity = fast_natural_arity & 0xff
if natural_arity > nargs >= natural_arity - len(self.defs_w):
assert isinstance(code, PyCode)
return self._flat_pycall_defaults(code, nargs, frame,
> natural_arity - nargs, dropvalues)
interpreter/function.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function fn>
code = <code object fn, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5>
nargs = 2
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23
defs_to_load = 1, dropvalues = 3
@jit.unroll_safe
def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
ndefs = len(self.defs_w)
start = ndefs - defs_to_load
i = nargs
for j in xrange(start, ndefs):
new_frame.locals_cells_stack_w[i] = self.defs_w[j]
i += 1
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> 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 fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> 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 fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> 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 fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> 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 fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16
pycode = <code object fn, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
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 fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16
co_code = '\x88\x03\x00\xc9\x00\x00|\x00\x00\xca\x01\x00\x01\x88\x02\x00\xc9\x01\x00\x88\x02\x00j\x02\x00d\x01\x00\xca\x02\x00}\...\x00|\x05\x00\x88\x03\x00_\x04\x00\x88\x03\x00\xc9\x00\x00t\x07\x00\xca\x01\x00\x01X|\x04\x00\xc9\x08\x00\xca\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
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 fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16
co_code = '\x88\x03\x00\xc9\x00\x00|\x00\x00\xca\x01\x00\x01\x88\x02\x00\xc9\x01\x00\x88\x02\x00j\x02\x00d\x01\x00\xca\x02\x00}\...\x00|\x05\x00\x88\x03\x00_\x04\x00\x88\x03\x00\xc9\x00\x00t\x07\x00\xca\x01\x00\x01X|\x04\x00\xc9\x08\x00\xca\x00\x00S'
next_instr = 108L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f6f4c>
@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 fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16
nameindex = 6, ignored = (108L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf525fa8c>
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 0xf525fa8c>
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 0xf525fa8c>
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
=========================== short test summary info ============================
FAIL module/_file/test/test_file.py::AppTestFile::()::test_exception_from_del
FAIL module/_file/test/test_file.py::AppTestFile::()::test_track_resources
============== 2 failed, 255 passed, 12 skipped in 596.35 seconds ==============
++ 08:40:13 starting module/_weakref/test [32 started in total]
__ module/_socket/test [29 done in total, somefailed=True] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 60 items
module/_socket/test/test_sock_app.py ...............................F...........s.....s.........
module/_socket/test/test_ztranslation.py .
=================================== FAILURES ===================================
______________________ AppTestSocket.test_track_resources ______________________
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 0xf4d8be9c>, 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_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>}
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 0xf7a3532c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d24cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>}
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 0xf69d24cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>}
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_track_resources'>, '__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 0xf4d82f54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__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 0xf4d98b6c>
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 0xf4d98b6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__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_track_resources'>, '__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 0xf4e2c504>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__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 0xf4d9892c>
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 0xf4d9892c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__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_track_resources'>, '__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_track_resources'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_track_resources'>
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_track_resources'>, space = StdObjSpace
target = <function test_track_resources at 0xf4d6ed14>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4dc0b2c>)
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 0xf4dc0b2c>,)
w_func = <Function test_track_resources>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4dc0b2c>
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_track_resources>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4dc0b2c>,)
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_track_resources>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4dc0b2c>,)
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_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', 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_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
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_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
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_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
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_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
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_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
pycode = <code object test_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e5570c>
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_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x02\x00d\x01\x00d\x00\x00l\x02\x00\x89\x03\x00d\x...t\x05\x00t\x07\x00\x83\x02\x00}\x03\x00\xcc\x12\x00|\x03\x00d\x03\x00k\x02\x00s\xed\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e5570c>
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_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x02\x00d\x01\x00d\x00\x00l\x02\x00\x89\x03\x00d\x...t\x05\x00t\x07\x00\x83\x02\x00}\x03\x00\xcc\x12\x00|\x03\x00d\x03\x00k\x02\x00s\xed\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 102L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e5570c>
@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)
interpreter/pyopcode.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
oparg = 2, next_instr = 102L
def CALL_FUNCTION(self, oparg, next_instr):
# XXX start of hack for performance
if (oparg >> 8) & 0xff == 0:
# Only positional arguments
nargs = oparg & 0xff
w_function = self.peekvalue(nargs)
> w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/pyopcode.py:1233:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function fn>, nargs = 2
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
dropvalues = 3, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function fn>, nargs = 2
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
dropvalues = 3, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
return self._flat_pycall(code, nargs, frame, dropvalues)
elif fast_natural_arity & Code.FLATPYCALL:
natural_arity = fast_natural_arity & 0xff
if natural_arity > nargs >= natural_arity - len(self.defs_w):
assert isinstance(code, PyCode)
return self._flat_pycall_defaults(code, nargs, frame,
> natural_arity - nargs, dropvalues)
interpreter/function.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function fn>
code = <code object fn, file '[/build_dir/own-linux-x86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5>
nargs = 2
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23
defs_to_load = 1, dropvalues = 3
@jit.unroll_safe
def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
ndefs = len(self.defs_w)
start = ndefs - defs_to_load
i = nargs
for j in xrange(start, ndefs):
new_frame.locals_cells_stack_w[i] = self.defs_w[j]
i += 1
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> 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 fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> 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 fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> 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 fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> 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 fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16
pycode = <code object fn, file '[/build_dir/own-linux-x86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e5570c>
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 fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16
co_code = '\x88\x03\x00\xc9\x00\x00|\x00\x00\xca\x01\x00\x01\x88\x00\x00\xc9\x01\x00\x88\x00\x00j\x02\x00\x88\x00\x00j\x03\x00d\...00\x00|\x05\x00\x88\x03\x00_\x05\x00\x88\x03\x00\xc9\x00\x00t\x08\x00\xca\x01\x00\x01X|\x04\x00\xc9\t\x00\xca\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e5570c>
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 fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16
co_code = '\x88\x03\x00\xc9\x00\x00|\x00\x00\xca\x01\x00\x01\x88\x00\x00\xc9\x01\x00\x88\x00\x00j\x02\x00\x88\x00\x00j\x03\x00d\...00\x00|\x05\x00\x88\x03\x00_\x05\x00\x88\x03\x00\xc9\x00\x00t\x08\x00\xca\x01\x00\x01X|\x04\x00\xc9\t\x00\xca\x00\x00S'
next_instr = 114L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4e5570c>
@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 fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16
nameindex = 7, ignored = (114L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4e5ca6c>
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 0xf4e5ca6c>
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 0xf4e5ca6c>
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
=========================== short test summary info ============================
FAIL module/_socket/test/test_sock_app.py::AppTestSocket::()::test_track_resources
=============== 1 failed, 57 passed, 2 skipped in 129.17 seconds ===============
++ 08:40:19 starting module/_winreg/test [33 started in total]
__ module/_winreg/test [30 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.12 seconds ===========================
++ 08:40:21 starting module/array/test [34 started in total]
__ module/_warnings/test [31 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 12 items
module/_warnings/test/apptest_warnings.py ...........
module/_warnings/test/test_warnings.py .
========================== 12 passed in 30.14 seconds ==========================
++ 08:40:33 starting module/binascii/test [35 started in total]
__ module/_sre/test [32 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 139 items
module/_sre/test/test_app_sre.py ..............................................s...................................s.s..............................
module/_sre/test/test_sre_buf.py ........................
=================== 136 passed, 3 skipped in 121.30 seconds ====================
++ 08:40:34 starting module/bz2/test [36 started in total]
__ module/binascii/test [33 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 14 items
module/binascii/test/test_binascii.py ..............
========================== 14 passed in 20.21 seconds ==========================
++ 08:40:57 starting module/cStringIO/test [37 started in total]
__ module/_weakref/test [34 done in total, somefailed=True] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 42 items
module/_weakref/test/test_weakref.py F..FFFF.FF..FFFFFFF.sF.......FF...FF......
=================================== FAILURES ===================================
__________________________ AppTestWeakref.test_simple __________________________
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 0xf75e1144>, 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_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_simple'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_simple'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_simple'>}
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_simple'>, '__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 0xf50df3ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_simple'>, '__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 0xf513462c>
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 0xf513462c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_simple'>, '__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_simple'>, '__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 0xf50df25c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_simple'>, '__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 0xf513464c>
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 0xf513464c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_simple'>, '__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_simple'>, '__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_simple'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_simple'>
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_simple'>, space = StdObjSpace
target = <function test_simple at 0xf50da224>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_simple>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_simple>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_simple>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_simple, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', 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_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12
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_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12
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_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12
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_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12
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_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12
pycode = <code object test_simple, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x07\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\xd7\x00t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x07\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\xd7\x00t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 187L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12
nameindex = 7, ignored = (187L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
_________________________ AppTestWeakref.test_callback _________________________
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 0xf4fa156c>, 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_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback'>}
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_callback'>, '__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 0xf4ff2e8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_callback'>, '__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 0xf4fcd2cc>
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 0xf4fcd2cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_callback'>, '__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_callback'>, '__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 0xf4ff8f7c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_callback'>, '__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 0xf4fcd3cc>
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 0xf4fcd3cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_callback'>, '__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_callback'>, '__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_callback'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_callback'>
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_callback'>, space = StdObjSpace
target = <function test_callback at 0xf4f04534>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_callback>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_callback>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_callback>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_callback, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', 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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13
pycode = <code object test_callback, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...b3\x00t\x05\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x03\x00d\x00\x00k\x08\x00s\xcb\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...b3\x00t\x05\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x03\x00d\x00\x00k\x08\x00s\xcb\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 151L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13
nameindex = 6, ignored = (151L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
______________________ AppTestWeakref.test_callback_order ______________________
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 0xf4f045dc>, 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_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_order'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_order'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_order'>}
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_callback_order'>, '__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 0xf50a839c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...back_order'>, '__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 0xf5051a4c>
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 0xf5051a4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...back_order'>, '__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_callback_order'>, '__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 0xf4f7c02c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...back_order'>, '__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 0xf5051a8c>
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 0xf5051a8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...back_order'>, '__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_callback_order'>, '__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_callback_order'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_callback_order'>
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_callback_order'>, space = StdObjSpace
target = <function test_callback_order at 0xf4a80294>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_callback_order>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_callback_order>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_callback_order>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_callback_order, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', 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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14
pycode = <code object test_callback_order, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x05\x00d\x06\x00k\x02\x00s\xa7\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x05\x00d\x06\x00k\x02\x00s\xa7\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 139L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14
nameindex = 4, ignored = (139L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
______________ AppTestWeakref.test_dont_callback_if_weakref_dead _______________
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 0xf4a80d4c>, 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_dont_callback_if_weakref_dead'>...call__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>...call__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>...call__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>}
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_dont_callback_if_weakref_dead'>, '__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 0xf4ff8fa4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...akref_dead'>, '__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 0xf4b385ac>
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 0xf4b385ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...akref_dead'>, '__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_dont_callback_if_weakref_dead'>, '__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 0xf4f7c75c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...akref_dead'>, '__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 0xf4b385ec>
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 0xf4b385ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...akref_dead'>, '__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_dont_callback_if_weakref_dead'>, '__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_dont_callback_if_weakref_dead'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_dont_callback_if_weakref_dead'>
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_dont_callback_if_weakref_dead'>, space = StdObjSpace
target = <function test_dont_callback_if_weakref_dead at 0xf4e84fb4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_dont_callback_if_weakref_dead>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_dont_callback_if_weakref_dead>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_dont_callback_if_weakref_dead>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_dont_callback_if_weakref_dead, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', 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_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14
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_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14
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_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14
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_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14
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_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14
pycode = <code object test_dont_callback_if_weakref_dead, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x07\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x03\x00d\x04\x00k\x02\x00s\xfc\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x07\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x03\x00d\x04\x00k\x02\x00s\xfc\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 178L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14
nameindex = 7, ignored = (178L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
________________ AppTestWeakref.test_callback_cannot_ressurect _________________
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 0xf50280d4>, 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_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_cannot_ressurect'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_cannot_ressurect'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_cannot_ressurect'>}
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_callback_cannot_ressurect'>, '__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 0xf4e5152c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._ressurect'>, '__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 0xf4e7354c>
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 0xf4e7354c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._ressurect'>, '__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_callback_cannot_ressurect'>, '__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 0xf4e2b20c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._ressurect'>, '__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 0xf4e7358c>
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 0xf4e7358c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._ressurect'>, '__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_callback_cannot_ressurect'>, '__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_callback_cannot_ressurect'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_callback_cannot_ressurect'>
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_callback_cannot_ressurect'>, space = StdObjSpace
target = <function test_callback_cannot_ressurect at 0xf4e774fc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_callback_cannot_ressurect>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_callback_cannot_ressurect>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_callback_cannot_ressurect>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_callback_cannot_ressurect, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', 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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13
pycode = <code object test_callback_cannot_ressurect, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x03\x00d\x00\x00k\x08\x00s\xa4\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x03\x00d\x00\x00k\x08\x00s\xa4\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 136L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13
nameindex = 5, ignored = (136L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
_____________ AppTestWeakref.test_correct_weakrefcount_after_death _____________
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 0xf4e77ed4>, 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_correct_weakrefcount_after_deat...l__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_correct_weakrefcount_after_deat...l__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_correct_weakrefcount_after_deat...l__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>}
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_correct_weakrefcount_after_death'>, '__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 0xf4e6a784>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...fter_death'>, '__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 0xf47c092c>
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 0xf47c092c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...fter_death'>, '__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_correct_weakrefcount_after_death'>, '__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 0xf4e6ad4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...fter_death'>, '__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 0xf47c0f8c>
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 0xf47c0f8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...fter_death'>, '__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_correct_weakrefcount_after_death'>, '__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_correct_weakrefcount_after_death'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_correct_weakrefcount_after_death'>
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_correct_weakrefcount_after_death'>
space = StdObjSpace
target = <function test_correct_weakrefcount_after_death at 0xf4e97dbc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_correct_weakrefcount_after_death>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_correct_weakrefcount_after_death>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_correct_weakrefcount_after_death>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_correct_weakrefcount_after_death, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', 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_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10
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_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10
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_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10
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_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10
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_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10
pycode = <code object test_correct_weakrefcount_after_death, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\x01\xcc\x1b\x00|\x01\x00\xc9\x04\x00|\x04\x00\xca\x01\x00d\x05\x00k\x02\x00s\xc9\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\x01\xcc\x1b\x00|\x01\x00\xc9\x04\x00|\x04\x00\xca\x01\x00d\x05\x00k\x02\x00s\xc9\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 124L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10
nameindex = 6, ignored = (124L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
_____________________ AppTestWeakref.test_weakref_equality _____________________
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 0xf4e97f44>, 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_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_equality'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_equality'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_equality'>}
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_weakref_equality'>, '__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 0xf4e2b16c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...f_equality'>, '__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 0xf4d7b58c>
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 0xf4d7b58c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...f_equality'>, '__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_weakref_equality'>, '__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 0xf4e2b20c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...f_equality'>, '__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 0xf4d7b5ac>
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 0xf4d7b5ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...f_equality'>, '__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_weakref_equality'>, '__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_weakref_equality'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_weakref_equality'>
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_weakref_equality'>, space = StdObjSpace
target = <function test_weakref_equality at 0xf4e53aac>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_weakref_equality>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_weakref_equality>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_weakref_equality>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_weakref_equality, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', 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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17
pycode = <code object test_weakref_equality, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\x00k\x02\x00r_\x01t\x04\x00\x82\x01\x00\xcc\x12\x00|\x06\x00g\x00\x00k\x03\x00st\x01t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\x00k\x02\x00r_\x01t\x04\x00\x82\x01\x00\xcc\x12\x00|\x06\x00g\x00\x00k\x03\x00st\x01t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 187L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17
nameindex = 5, ignored = (187L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
_________________________ AppTestWeakref.test_hashing __________________________
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 0xf4e6641c>, 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_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hashing'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hashing'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hashing'>}
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_hashing'>, '__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 0xf509b414>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_hashing'>, '__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 0xf47fd6cc>
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 0xf47fd6cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_hashing'>, '__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_hashing'>, '__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 0xf493fcfc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_hashing'>, '__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 0xf47fde0c>
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 0xf47fde0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_hashing'>, '__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_hashing'>, '__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_hashing'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_hashing'>
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_hashing'>, space = StdObjSpace
target = <function test_hashing at 0xf4e97dbc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_hashing>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_hashing>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_hashing>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_hashing, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', 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_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10
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_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10
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_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10
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_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10
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_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10
pycode = <code object test_hashing, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...ca\x01\x00}\x05\x00|\x02\x00\xc9\x06\x00\xca\x00\x00\x01t\x07\x00t\x08\x00t\x04\x00|\x05\x00\x83\x03\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...ca\x01\x00}\x05\x00|\x02\x00\xc9\x06\x00\xca\x00\x00\x01t\x07\x00t\x08\x00t\x04\x00|\x05\x00\x83\x03\x00\x01d\x00\x00S'
next_instr = 112L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10
nameindex = 6, ignored = (112L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
___________________ AppTestWeakref.test_weakref_subclassing ____________________
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 0xf4e75dbc>, 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_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclassing'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclassing'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclassing'>}
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_weakref_subclassing'>, '__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 0xf4e67f54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ubclassing'>, '__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 0xf505a02c>
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 0xf505a02c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ubclassing'>, '__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_weakref_subclassing'>, '__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 0xf4e67194>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ubclassing'>, '__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 0xf505a0cc>
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 0xf505a0cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ubclassing'>, '__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_weakref_subclassing'>, '__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_weakref_subclassing'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_weakref_subclassing'>
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_weakref_subclassing'>, space = StdObjSpace
target = <function test_weakref_subclassing at 0xf4fbd6f4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_weakref_subclassing>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_weakref_subclassing>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_weakref_subclassing>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_weakref_subclassing, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', 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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22
pycode = <code object test_weakref_subclassing, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...sz\x01t\x06\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x04\x00d\x0b\x00k\x02\x00s\x92\x01t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...sz\x01t\x06\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x04\x00d\x0b\x00k\x02\x00s\x92\x01t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 302L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22
nameindex = 9, ignored = (302L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
___________________ AppTestWeakref.test_function_weakrefable ___________________
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 0xf4e66d14>, 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_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_function_weakrefable'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_function_weakrefable'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_function_weakrefable'>}
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_function_weakrefable'>, '__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 0xf504c70c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf4d8d0cc>
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 0xf4d8d0cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_function_weakrefable'>, '__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 0xf504c374>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf4d8d42c>
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 0xf4d8d42c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_function_weakrefable'>, '__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_function_weakrefable'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_function_weakrefable'>
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_function_weakrefable'>, space = StdObjSpace
target = <function test_function_weakrefable at 0xf4e84fb4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_function_weakrefable>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_function_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_function_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_function_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', 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_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8
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_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8
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_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8
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_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8
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_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8
pycode = <code object test_function_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00\x84\x00\x00}\x03\x00|\x01\x00\xc9\x...00\xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00ss\x00t\x03\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00\x84\x00\x00}\x03\x00|\x01\x00\xc9\x...00\xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00ss\x00t\x03\x00\x82\x01\x00d\x00\x00S'
next_instr = 87L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8
nameindex = 4, ignored = (87L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
____________________ AppTestWeakref.test_method_weakrefable ____________________
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 0xf49928ec>, 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_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_method_weakrefable'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_method_weakrefable'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_method_weakrefable'>}
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_method_weakrefable'>, '__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 0xf504c414>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf4fffc8c>
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 0xf4fffc8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_method_weakrefable'>, '__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 0xf498ae3c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf4fffdac>
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 0xf4fffdac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_method_weakrefable'>, '__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_method_weakrefable'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_method_weakrefable'>
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_method_weakrefable'>, space = StdObjSpace
target = <function test_method_weakrefable at 0xf4ab68ec>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_method_weakrefable>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_method_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_method_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_method_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', 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_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14
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_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14
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_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14
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_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14
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_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14
pycode = <code object test_method_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...cb\x00t\x05\x00\x82\x01\x00\xcc\x15\x00|\x07\x00\x83\x00\x00d\x00\x00k\x08\x00s\xe3\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...cb\x00t\x05\x00\x82\x01\x00\xcc\x15\x00|\x07\x00\x83\x00\x00d\x00\x00k\x08\x00s\xe3\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 175L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14
nameindex = 6, ignored = (175L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
_____________________ AppTestWeakref.test_set_weakrefable ______________________
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 0xf4e66ae4>, 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_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_set_weakrefable'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_set_weakrefable'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_set_weakrefable'>}
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_set_weakrefable'>, '__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 0xf4bf88c4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf4c2f32c>
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 0xf4c2f32c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_set_weakrefable'>, '__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 0xf4bf8be4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf4c2f02c>
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 0xf4c2f02c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_set_weakrefable'>, '__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_set_weakrefable'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_set_weakrefable'>
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_set_weakrefable'>, space = StdObjSpace
target = <function test_set_weakrefable at 0xf4a80d14>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_set_weakrefable>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_set_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_set_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_set_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', 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_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7
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_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7
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_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7
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_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7
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_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7
pycode = <code object test_set_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00t\x02\x00d\x02\x00d\x03\x00d\x04\x00d\x05\x00...00\xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00s|\x00t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00t\x02\x00d\x02\x00d\x03\x00d\x04\x00d\x05\x00...00\xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00s|\x00t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 96L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7
nameindex = 5, ignored = (96L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
__________________ AppTestWeakref.test_generator_weakrefable ___________________
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 0xf4a80a3c>, 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_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_generator_weakrefable'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_generator_weakrefable'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_generator_weakrefable'>}
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_generator_weakrefable'>, '__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 0xf4e6acac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf480faac>
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 0xf480faac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_generator_weakrefable'>, '__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 0xf506ccac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf480fd0c>
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 0xf480fd0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_generator_weakrefable'>, '__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_generator_weakrefable'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_generator_weakrefable'>
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_generator_weakrefable'>, space = StdObjSpace
target = <function test_generator_weakrefable at 0xf4ab6294>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_generator_weakrefable>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_generator_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_generator_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_generator_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', 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_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13
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_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13
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_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13
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_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13
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_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13
pycode = <code object test_generator_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00\x84\x00\x00}\x03\x00|\x03\x00d\x03\...xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\x07\x01t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00\x84\x00\x00}\x03\x00|\x03\x00d\x03\...xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\x07\x01t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 138L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13
nameindex = 5, ignored = (138L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
________________ AppTestWeakref.test_weakref_subclass_with_del _________________
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 0xf4ab6374>, 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_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclass_with_del'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclass_with_del'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclass_with_del'>}
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_weakref_subclass_with_del'>, '__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 0xf4e67a04>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...s_with_del'>, '__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 0xf4810e0c>
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 0xf4810e0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...s_with_del'>, '__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_weakref_subclass_with_del'>, '__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 0xf4e677fc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...s_with_del'>, '__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 0xf481072c>
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 0xf481072c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...s_with_del'>, '__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_weakref_subclass_with_del'>, '__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_weakref_subclass_with_del'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_weakref_subclass_with_del'>
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_weakref_subclass_with_del'>, space = StdObjSpace
target = <function test_weakref_subclass_with_del at 0xf4a3fbc4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_weakref_subclass_with_del>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_weakref_subclass_with_del>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_weakref_subclass_with_del>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_weakref_subclass_with_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', 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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13
pycode = <code object test_weakref_subclass_with_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00|\x01\x00j\x02\x00f\x01\x00\x87\x00\...8\x00|\x05\x00\xca\x01\x00d\x08\x00\x19\x83\x00\x00|\x05\x00k\x08\x00s\xd3\x00t\x06\x00\x82\x01\x00n\x00\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00|\x01\x00j\x02\x00f\x01\x00\x87\x00\...8\x00|\x05\x00\xca\x01\x00d\x08\x00\x19\x83\x00\x00|\x05\x00k\x08\x00s\xd3\x00t\x06\x00\x82\x01\x00n\x00\x00d\x00\x00S'
next_instr = 125L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13
nameindex = 5, ignored = (125L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
_____________________ AppTestWeakref.test_type_weakrefable _____________________
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 0xf4a39e9c>, 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_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_weakrefable'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_weakrefable'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_weakrefable'>}
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_type_weakrefable'>, '__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 0xf47c86bc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf491838c>
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 0xf491838c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_type_weakrefable'>, '__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 0xf47c8414>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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 0xf4918b2c>
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 0xf4918b2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__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_type_weakrefable'>, '__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_type_weakrefable'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_type_weakrefable'>
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_type_weakrefable'>, space = StdObjSpace
target = <function test_type_weakrefable at 0xf502d4c4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>)
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 0xf51346cc>,)
w_func = <Function test_type_weakrefable>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>
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_type_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_type_weakrefable>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51346cc>,)
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_type_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', 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_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5
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_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5
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_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5
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_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5
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_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5
pycode = <code object test_type_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00t\x03\x00\xca\x01\x00}\x...3\x00\x00t\x03\x00k\x08\x00sa\x00t\x04\x00\x82\x01\x00d\x00\x00S\x03\x00k\x08\x00sa\x00t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00t\x03\x00\xca\x01\x00}\x...3\x00\x00t\x03\x00k\x08\x00sa\x00t\x04\x00\x82\x01\x00d\x00\x00S\x03\x00k\x08\x00sa\x00t\x04\x00\x82\x01\x00d\x00\x00S'
next_instr = 69L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5
nameindex = 5, ignored = (69L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
____________________ AppTestProxy.test_proxy_to_dead_object ____________________
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 0xf4ab6374>, 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_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_to_dead_object'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_to_dead_object'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_to_dead_object'>}
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_proxy_to_dead_object'>, '__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 0xf47ddd4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_object'>, '__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 0xf4dd3f4c>
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 0xf4dd3f4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_object'>, '__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_proxy_to_dead_object'>, '__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 0xf47f5c5c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_object'>, '__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 0xf4dd354c>
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 0xf4dd354c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_object'>, '__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_proxy_to_dead_object'>, '__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_proxy_to_dead_object'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_proxy_to_dead_object'>
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_proxy_to_dead_object'>, space = StdObjSpace
target = <function test_proxy_to_dead_object at 0xf4a8079c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>)
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 0xf4cdf3ac>,)
w_func = <Function test_proxy_to_dead_object>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>
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_proxy_to_dead_object>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>,)
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_proxy_to_dead_object>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>,)
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_proxy_to_dead_object, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', 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_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6
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_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6
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_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6
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_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6
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_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6
pycode = <code object test_proxy_to_dead_object, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...83\x02\x00\x01d\x00\x00S\x00|\x02\x00\xc9\x04\x00\xca\x00\x00\x01t\x05\x00t\x06\x00d\x04\x00\x83\x02\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...83\x02\x00\x01d\x00\x00S\x00|\x02\x00\xc9\x04\x00\xca\x00\x00\x01t\x05\x00t\x06\x00d\x04\x00\x83\x02\x00\x01d\x00\x00S'
next_instr = 70L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6
nameindex = 4, ignored = (70L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
____________________ AppTestProxy.test_proxy_with_callback _____________________
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 0xf4f226f4>, 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_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_with_callback'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_with_callback'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_with_callback'>}
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_proxy_with_callback'>, '__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 0xf47a8edc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...h_callback'>, '__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 0xf4a1430c>
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 0xf4a1430c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...h_callback'>, '__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_proxy_with_callback'>, '__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 0xf47a8e14>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...h_callback'>, '__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 0xf4a14c8c>
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 0xf4a14c8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...h_callback'>, '__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_proxy_with_callback'>, '__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_proxy_with_callback'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_proxy_with_callback'>
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_proxy_with_callback'>, space = StdObjSpace
target = <function test_proxy_with_callback at 0xf4a399cc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>)
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 0xf4cdf3ac>,)
w_func = <Function test_proxy_with_callback>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>
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_proxy_with_callback>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>,)
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_proxy_with_callback>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>,)
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_proxy_with_callback, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', 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_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9
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_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9
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_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9
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_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9
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_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9
pycode = <code object test_proxy_with_callback, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00d\x05\x00\x83\x02\x00\x01\xcc\x15\x00\x88\x00\x00j\x07\x00|\x05\x00k\x08\x00s\x8a\x00t\x08\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00d\x05\x00\x83\x02\x00\x01\xcc\x15\x00\x88\x00\x00j\x07\x00|\x05\x00k\x08\x00s\x8a\x00t\x08\x00\x82\x01\x00d\x00\x00S'
next_instr = 97L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9
nameindex = 4, ignored = (97L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
______________________ AppTestProxy.test_callback_raises _______________________
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 0xf4f264fc>, 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_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_raises'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_raises'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_raises'>}
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_callback_raises'>, '__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 0xf4a4461c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ack_raises'>, '__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 0xf477f28c>
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 0xf477f28c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ack_raises'>, '__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_callback_raises'>, '__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 0xf4a440cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ack_raises'>, '__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 0xf477fc6c>
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 0xf477fc6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ack_raises'>, '__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_callback_raises'>, '__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_callback_raises'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_callback_raises'>
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_callback_raises'>, space = StdObjSpace
target = <function test_callback_raises at 0xf4fbd72c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>)
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 0xf4cdf3ac>,)
w_func = <Function test_callback_raises>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>
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_callback_raises>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>,)
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_callback_raises>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>,)
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_callback_raises, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', 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_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10
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_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10
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_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10
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_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10
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_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10
pycode = <code object test_callback_raises, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x06\x00\x83\x00\x00d\x00\x00k\x08\x00sw\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x06\x00\x83\x00\x00d\x00\x00k\x08\x00sw\x00t\x05\x00\x82\x01\x00d\x00\x00S'
next_instr = 91L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10
nameindex = 4, ignored = (91L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
----------------------------- Captured stderr call -----------------------------
Exception NameError: "global name 'explode' is not defined" in weakref callback <function callback at 0xf49fa7cc> ignored
____________________________ AppTestProxy.test_init ____________________________
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 0xf4a1eb1c>, 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_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>}
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 0xf79f132c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>}
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 0xf698e4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>}
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_init'>, '__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 0xf4af3dc4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_init'>, '__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 0xf482fe0c>
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 0xf482fe0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_init'>, '__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_init'>, '__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 0xf4af3cfc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_init'>, '__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 0xf482f6ac>
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 0xf482f6ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_init'>, '__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_init'>, '__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_init'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_init'>
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_init'>, space = StdObjSpace
target = <function test_init at 0xf4a1eb8c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>)
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 0xf4cdf3ac>,)
w_func = <Function test_init>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>
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_init>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>,)
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_init>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4cdf3ac>,)
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_init, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', 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_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8
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_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8
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_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8
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_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8
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_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8
pycode = <code object test_init, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00t\x03\x00\xca\x01\x00}\x...0S\x06\x00d\x02\x00d\x02\x00d\x02\x00d\x02\x00d\x02\x00\x83\x07\x00\x01|\x02\x00\xc9\x07\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
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_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00t\x03\x00\xca\x01\x00}\x...0S\x06\x00d\x02\x00d\x02\x00d\x02\x00d\x02\x00d\x02\x00\x83\x07\x00\x01|\x02\x00\xc9\x07\x00\xca\x00\x00\x01d\x00\x00S'
next_instr = 76L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf511bfcc>
@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_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8
nameindex = 7, ignored = (76L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ed24c>
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 0xf52ed24c>
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 0xf52ed24c>
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
=========================== short test summary info ============================
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_simple
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_callback
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_callback_order
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_dont_callback_if_weakref_dead
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_callback_cannot_ressurect
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_correct_weakrefcount_after_death
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_weakref_equality
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_hashing
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_weakref_subclassing
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_function_weakrefable
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_method_weakrefable
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_set_weakrefable
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_generator_weakrefable
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_weakref_subclass_with_del
FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_type_weakrefable
FAIL module/_weakref/test/test_weakref.py::AppTestProxy::()::test_proxy_to_dead_object
FAIL module/_weakref/test/test_weakref.py::AppTestProxy::()::test_proxy_with_callback
FAIL module/_weakref/test/test_weakref.py::AppTestProxy::()::test_callback_raises
FAIL module/_weakref/test/test_weakref.py::AppTestProxy::()::test_init
=============== 19 failed, 22 passed, 1 skipped in 59.47 seconds ===============
++ 08:41:19 starting module/cmath/test [38 started in total]
__ module/cStringIO/test [35 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 16 items
module/cStringIO/test/test_interp_stringio.py ...............
module/cStringIO/test/test_ztranslation.py .
========================== 16 passed in 28.89 seconds ==========================
++ 08:41:30 starting module/cpyext/test/test_abstract.py [39 started in total]
__ module/cmath/test [36 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 15 items
module/cmath/test/test_cmath.py ...............
========================== 15 passed in 12.79 seconds ==========================
++ 08:41:33 starting module/cpyext/test/test_api.py [40 started in total]
__ module/array/test [37 done in total, somefailed=True] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 49 items
module/array/test/test_array.py ....................................s..F........
module/array/test/test_ztranslation.py .
=================================== FAILURES ===================================
________________________ AppTestArray.test_subclass_del ________________________
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 0xf42838ec>, 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_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_del'>}
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 0xf7a7732c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a144cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_del'>}
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 0xf6a144cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_del'>}
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_subclass_del'>, '__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 0xf4299edc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...bclass_del'>, '__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 0xf428bbac>
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 0xf428bbac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...bclass_del'>, '__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_subclass_del'>, '__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 0xf4299e14>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...bclass_del'>, '__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 0xf428b02c>
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 0xf428b02c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...bclass_del'>, '__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_subclass_del'>, '__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_subclass_del'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_subclass_del'>
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_subclass_del'>, space = StdObjSpace
target = <function test_subclass_del at 0xf429664c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50852ac>)
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 0xf50852ac>,)
w_func = <Function test_subclass_del>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50852ac>
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_subclass_del>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50852ac>,)
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_subclass_del>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50852ac>,)
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_subclass_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/array/test/test_array.py:919]', 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_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12
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_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12
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_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12
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_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12
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_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12
pycode = <code object test_subclass_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf512d86c>
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_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00g\x00\x00...8\x00s\xcc\x00t\x07\x00\x88\x00\x00d\x07\x00\x19\x83\x01\x00d\x07\x00k\x02\x00s\xcc\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf512d86c>
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_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00g\x00\x00...8\x00s\xcc\x00t\x07\x00\x88\x00\x00d\x07\x00\x19\x83\x01\x00d\x07\x00k\x02\x00s\xcc\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 128L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf512d86c>
@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_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12
nameindex = 5, ignored = (128L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52dbb0c>
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 0xf52dbb0c>
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 0xf52dbb0c>
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
=========================== short test summary info ============================
FAIL module/array/test/test_array.py::AppTestArray::()::test_subclass_del
=============== 1 failed, 47 passed, 1 skipped in 111.63 seconds ===============
++ 08:42:17 starting module/cpyext/test/test_arraymodule.py [41 started in total]
__ module/cpyext/test/test_api.py [38 done in total, somefailed=False] ________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 4 items
module/cpyext/test/test_api.py ....
========================== 4 passed in 68.61 seconds ===========================
++ 08:43:01 starting module/cpyext/test/test_boolobject.py [42 started in total]
__ module/cpyext/test/test_abstract.py [39 done in total, somefailed=False] ___
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 7 items
module/cpyext/test/test_abstract.py .......
========================== 7 passed in 101.35 seconds ==========================
++ 08:43:33 starting module/cpyext/test/test_borrow.py [43 started in total]
__ module/bz2/test [40 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 52 items
module/bz2/test/test_bz2_compdecomp.py ..s...........s...
module/bz2/test/test_bz2_file.py .................................
module/bz2/test/test_large.py s
==================== 49 passed, 3 skipped in 181.89 seconds ====================
++ 08:43:42 starting module/cpyext/test/test_bufferobject.py [44 started in total]
__ module/cpyext/test/test_boolobject.py [41 done in total, somefailed=False] _
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 4 items
module/cpyext/test/test_boolobject.py ....
========================== 4 passed in 82.88 seconds ===========================
++ 08:44:42 starting module/cpyext/test/test_bytearrayobject.py [45 started in total]
__ module/cpyext/test/test_borrow.py [42 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items
module/cpyext/test/test_borrow.py ...
========================== 3 passed in 90.42 seconds ===========================
++ 08:45:22 starting module/cpyext/test/test_bytesobject.py [46 started in total]
__ module/cpyext/test/test_bufferobject.py [43 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 4 items
module/cpyext/test/test_bufferobject.py ....
========================== 4 passed in 116.26 seconds ==========================
++ 08:46:00 starting module/cpyext/test/test_capsule.py [47 started in total]
__ module/cpyext/test/test_arraymodule.py [44 done in total, somefailed=True] _
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 17 items
module/cpyext/test/test_arraymodule.py ..........x.....F
=================================== FAILURES ===================================
_______________ AppTestArrayModule.test_subclass_with_attribute ________________
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 0xf36f172c>, 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_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>}
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 0xf79e732c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4cf2e0c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>}
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 0xf4cf2e0c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>}
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_subclass_with_attribute'>, '__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 0xf35fb784>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._attribute'>, '__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 0xf355780c>
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 0xf355780c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._attribute'>, '__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_subclass_with_attribute'>, '__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 0xf35fb644>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._attribute'>, '__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 0xf355754c>
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 0xf355754c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._attribute'>, '__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_subclass_with_attribute'>, '__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_subclass_with_attribute'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_subclass_with_attribute'>
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_subclass_with_attribute'>, space = StdObjSpace
target = <function test_subclass_with_attribute at 0xf358baac>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4852a4c>)
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 0xf4852a4c>,)
w_func = <Function test_subclass_with_attribute>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4852a4c>
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_subclass_with_attribute>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4852a4c>,)
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_subclass_with_attribute>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4852a4c>,)
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_subclass_with_attribute, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', 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_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8
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_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8
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_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8
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_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8
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_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8
pycode = <code object test_subclass_with_attribute, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bf642c>
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_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8
co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00\xca\x00\x01}\x01\x00d\x03\x00|\x01\x00j\x01\x00f\x01\x00d\x04\x00\x84\x00\x00...cc\x15\x00|\x02\x00j\x05\x00t\x06\x00k\x02\x00sh\x00t\x07\x00\x82\x01\x00d\x00\x00S\x00t\x07\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bf642c>
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_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8
co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00\xca\x00\x01}\x01\x00d\x03\x00|\x01\x00j\x01\x00f\x01\x00d\x04\x00\x84\x00\x00...cc\x15\x00|\x02\x00j\x05\x00t\x06\x00k\x02\x00sh\x00t\x07\x00\x82\x01\x00d\x00\x00S\x00t\x07\x00\x82\x01\x00d\x00\x00S'
next_instr = 76L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bf642c>
@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)
interpreter/pyopcode.py:340:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8
nameindex = 4, next_instr = 76L
@always_inline
def LOAD_ATTR(self, nameindex, next_instr):
"obj.attributename"
w_obj = self.popvalue()
if not jit.we_are_jitted():
from pypy.objspace.std.mapdict import LOAD_ATTR_caching
> w_value = LOAD_ATTR_caching(self.getcode(), w_obj, nameindex)
interpreter/pyopcode.py:977:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pycode = <code object test_subclass_with_attribute, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1>
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4bc762c>, nameindex = 4
@objectmodel.always_inline
def LOAD_ATTR_caching(pycode, w_obj, nameindex):
# this whole mess is to make the interpreter quite a bit faster; it's not
# used if we_are_jitted().
entry = pycode._mapdict_caches[nameindex]
map = w_obj._get_mapdict_map()
if entry.is_valid_for_map(map) and entry.w_method is None:
# everything matches, it's incredibly fast
attr = entry.attr_wref()
if attr is not None:
return attr._direct_read(w_obj)
> return LOAD_ATTR_slowpath(pycode, w_obj, nameindex, map)
objspace/std/mapdict.py:1420:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pycode = <code object test_subclass_with_attribute, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1>
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4bc762c>, nameindex = 4
map = None
@objectmodel.dont_inline
def LOAD_ATTR_slowpath(pycode, w_obj, nameindex, map):
space = pycode.space
w_name = pycode.co_names_w[nameindex]
if map is not None:
w_type = map.terminator.w_cls
w_descr = w_type.getattribute_if_not_from_object()
if w_descr is not None:
return space._handle_getattribute(w_descr, w_obj, w_name)
version_tag = w_type.version_tag()
if version_tag is not None:
name = space.text_w(w_name)
# We need to care for obscure cases in which the w_descr is
# a MutableCell, which may change without changing the version_tag
_, w_descr = w_type._pure_lookup_where_with_method_cache(
name, version_tag)
#
attrname, attrkind = ("", INVALID)
if w_descr is None:
attrname, attrkind = (name, DICT) # common case: no such attr in the class
elif isinstance(w_descr, MutableCell):
pass # we have a MutableCell in the class: give up
elif space.is_data_descr(w_descr):
# we have a data descriptor, which means the dictionary value
# (if any) has no relevance.
from pypy.interpreter.typedef import Member
if isinstance(w_descr, Member): # it is a slot -- easy case
attrname, attrkind = ("slot", SLOTS_STARTING_FROM + w_descr.index)
elif not space.type(w_descr).is_heaptype():
# There is a non-data descriptor in the class. This would mean
# we use the dict entry, however, the class of w_descr could be
# changed to add a __get__/__set__ without the cache noticing,
# so we can only use the cache if w_descr is an instance of an
# immutable type. see
# test_load_attr_bug_class_name_turns_into_descriptor
attrname = name
attrkind = DICT
#
if attrkind != INVALID:
attr = map.find_map_attr(attrname, attrkind)
if attr is not None:
# Note that if map.terminator is a DevolvedDictTerminator
# or the class provides its own dict, not using mapdict, then:
# map.find_map_attr will always return None if attrkind==DICT.
_fill_cache(pycode, nameindex, map, version_tag, attr,
valid_for_store=w_type.setattr_if_not_from_object() is None)
return attr._direct_read(w_obj)
if space.config.objspace.std.withmethodcachecounter:
INVALID_CACHE_ENTRY.failure_counter += 1
> return space.getattr(w_obj, w_name)
objspace/std/mapdict.py:1471:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4bc762c>
w_name = W_BytesObject('collect')
def getattr(self, w_obj, w_name):
# an optional shortcut for performance
w_type = self.type(w_obj)
w_descr = w_type.getattribute_if_not_from_object()
if w_descr is not None:
return self._handle_getattribute(w_descr, w_obj, w_name)
# fast path: XXX this is duplicating most of the logic
# from the default __getattribute__ and the getattr() method...
name = self.text_w(w_name)
w_descr = w_type.lookup(name)
e = None
if w_descr is not None:
w_get = None
is_data = self.is_data_descr(w_descr)
if is_data:
w_get = self.lookup(w_descr, "__get__")
if w_get is None:
w_value = w_obj.getdictvalue(self, name)
if w_value is not None:
return w_value
if not is_data:
w_get = self.lookup(w_descr, "__get__")
if w_get is not None:
# __get__ is allowed to raise an AttributeError to trigger
# use of __getattr__.
try:
return self.get_and_call_function(w_get, w_descr, w_obj,
w_type)
except OperationError as e:
if not e.match(self, self.w_AttributeError):
raise
else:
return w_descr
else:
> w_value = w_obj.getdictvalue(self, name)
objspace/std/objspace.py:655:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.gc.moduledef.Module object at 0xf4bc762c>
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 0xf4bc762c>
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
----------------------------- Captured stderr call -----------------------------
<function _Py_InitPyPyModule at 0xf4ef7ca4> DONE
<function PyType_Ready at 0xf4e64b54> DONE
<function PyType_Ready at 0xf4e64b54> DONE
<function check at 0xf4ef7aac> DONE
<function PyModule_GetDict at 0xf4ef7d84> DONE
<function PyDict_SetItemString at 0xf4e16614> DONE
<function check at 0xf4ef7aac> DONE
<function PyModule_GetDict at 0xf4ef7d84> DONE
<function PyDict_SetItemString at 0xf4e16614> DONE
<function check at 0xf4ef7aac> DONE
<function PyModule_GetDict at 0xf4ef7d84> DONE
<function PyDict_SetItemString at 0xf4e16614> DONE
=========================== short test summary info ============================
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_subclass_with_attribute
=============== 1 failed, 15 passed, 1 xfailed in 212.26 seconds ===============
++ 08:46:09 starting module/cpyext/test/test_cell.py [48 started in total]
__ module/cpyext/test/test_bytearrayobject.py [45 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/cpyext/test/test_bytearrayobject.py ......
========================== 6 passed in 96.76 seconds ===========================
++ 08:46:38 starting module/cpyext/test/test_classobject.py [49 started in total]
__ module/cpyext/test/test_capsule.py [46 done in total, somefailed=True] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_capsule.py F
=================================== FAILURES ===================================
______________________ AppTestCapsule.test_capsule_import ______________________
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 0xf4c3c4c4>, 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_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_capsule_import'>}
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 0xf79dc32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4ce7a2c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_capsule_import'>}
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 0xf4ce7a2c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_capsule_import'>}
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_capsule_import'>, '__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 0xf41aee64>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ule_import'>, '__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 0xf417bc8c>
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 0xf417bc8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ule_import'>, '__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_capsule_import'>, '__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 0xf41aef2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ule_import'>, '__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 0xf417bccc>
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 0xf417bccc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ule_import'>, '__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_capsule_import'>, '__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_capsule_import'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_capsule_import'>
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_capsule_import'>, space = StdObjSpace
target = <function test_capsule_import at 0xf4164374>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4800b0c>)
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 0xf4800b0c>,)
w_func = <Function test_capsule_import>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4800b0c>
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_capsule_import>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4800b0c>,)
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_capsule_import>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4800b0c>,)
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_capsule_import, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', 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_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24
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_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24
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_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24
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_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24
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_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24
pycode = <code object test_capsule_import, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bde3ac>
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_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24
co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00d\x03\x00g\x02\x00\xca\x02\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x04\x00\xca\x01\...\xcc\x18\x00|\x01\x00\xc9\x07\x00\xca\x00\x00d\x04\x00k\x02\x00st\x00t\x04\x00\x82\x01\x00|\x01\x00`\x03\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bde3ac>
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_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24
co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00d\x03\x00g\x02\x00\xca\x02\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x04\x00\xca\x01\...\xcc\x18\x00|\x01\x00\xc9\x07\x00\xca\x00\x00d\x04\x00k\x02\x00st\x00t\x04\x00\x82\x01\x00|\x01\x00`\x03\x00d\x00\x00S'
next_instr = 85L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bde3ac>
@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_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24
nameindex = 6, ignored = (85L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c2d56c>
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 0xf4c2d56c>
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 0xf4c2d56c>
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
----------------------------- Captured stderr call -----------------------------
<function _Py_InitPyPyModule at 0xf4eebcdc> DONE
<function PyLong_AsVoidPtr at 0xf4e651b4> DONE
<function PyErr_Occurred at 0xf4ecf5a4> DONE
<function PyErr_Occurred at 0xf4ecf5a4> DONE
<function PyImport_ImportModule at 0xf4ec0dbc> DONE
<function check at 0xf4eebae4> DONE
<function PyModule_GetDict at 0xf4eebdbc> DONE
<function PyDict_SetItemString at 0xf4e0c64c> DONE
<function PyErr_Occurred at 0xf4ecf5a4> DONE
<function PyString_FromStringAndSize at 0xf4e555a4> DONE
<function PyString_AS_STRING at 0xf4e5587c> DONE
<function PyString_AS_STRING at 0xf4e5587c> DONE
<function _PyString_Resize at 0xf4e55a3c> <function bytes_dealloc at 0xf4e554c4> DONE
DONE
=========================== short test summary info ============================
FAIL module/cpyext/test/test_capsule.py::AppTestCapsule::()::test_capsule_import
========================== 1 failed in 79.45 seconds ===========================
++ 08:47:34 starting module/cpyext/test/test_codecs.py [50 started in total]
__ module/cpyext/test/test_bytesobject.py [47 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 25 items
module/cpyext/test/test_bytesobject.py .........................
========================= 25 passed in 127.71 seconds ==========================
++ 08:47:47 starting module/cpyext/test/test_complexobject.py [51 started in total]
__ module/cpyext/test/test_cell.py [48 done in total, somefailed=False] _______
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_cell.py .
========================== 1 passed in 84.34 seconds ===========================
++ 08:47:50 starting module/cpyext/test/test_cpyext.py [52 started in total]
__ module/cpyext/test/test_classobject.py [49 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 5 items
module/cpyext/test/test_classobject.py .....
========================== 5 passed in 89.78 seconds ===========================
++ 08:48:27 starting module/cpyext/test/test_datetime.py [53 started in total]
__ module/cpyext/test/test_codecs.py [50 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 2 items
module/cpyext/test/test_codecs.py ..
========================== 2 passed in 68.14 seconds ===========================
++ 08:49:02 starting module/cpyext/test/test_dictobject.py [54 started in total]
__ module/cpyext/test/test_complexobject.py [51 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 5 items
module/cpyext/test/test_complexobject.py .....
========================== 5 passed in 83.31 seconds ===========================
++ 08:49:29 starting module/cpyext/test/test_eval.py [55 started in total]
__ module/cpyext/test/test_cpyext.py [52 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 27 items
module/cpyext/test/test_cpyext.py ...s.........s.............
==================== 25 passed, 2 skipped in 144.74 seconds ====================
++ 08:50:37 starting module/cpyext/test/test_fileobject.py [56 started in total]
__ module/cpyext/test/test_datetime.py [53 done in total, somefailed=False] ___
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 14 items
module/cpyext/test/test_datetime.py ..............
========================= 14 passed in 126.39 seconds ==========================
++ 08:50:52 starting module/cpyext/test/test_floatobject.py [57 started in total]
__ module/cpyext/test/test_dictobject.py [54 done in total, somefailed=False] _
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 18 items
module/cpyext/test/test_dictobject.py ..................
========================= 18 passed in 131.65 seconds ==========================
++ 08:51:34 starting module/cpyext/test/test_frameobject.py [58 started in total]
__ module/cpyext/test/test_eval.py [55 done in total, somefailed=False] _______
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 19 items
module/cpyext/test/test_eval.py ...................
========================= 19 passed in 116.41 seconds ==========================
++ 08:51:46 starting module/cpyext/test/test_funcobject.py [59 started in total]
__ module/cpyext/test/test_fileobject.py [56 done in total, somefailed=False] _
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_fileobject.py .
========================== 1 passed in 67.33 seconds ===========================
++ 08:52:04 starting module/cpyext/test/test_genobject.py [60 started in total]
__ module/cpyext/test/test_floatobject.py [57 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 15 items
module/cpyext/test/test_floatobject.py ...............
========================== 15 passed in 82.42 seconds ==========================
++ 08:52:34 starting module/cpyext/test/test_getargs.py [61 started in total]
__ module/cpyext/test/test_frameobject.py [58 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 2 items
module/cpyext/test/test_frameobject.py ..
========================== 2 passed in 52.00 seconds ===========================
++ 08:52:39 starting module/cpyext/test/test_import.py [62 started in total]
__ module/cpyext/test/test_funcobject.py [59 done in total, somefailed=False] _
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 7 items
module/cpyext/test/test_funcobject.py .......
========================== 7 passed in 47.43 seconds ===========================
++ 08:52:45 starting module/cpyext/test/test_intobject.py [63 started in total]
__ module/cpyext/test/test_genobject.py [60 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_genobject.py .
========================== 1 passed in 46.59 seconds ===========================
++ 08:53:03 starting module/cpyext/test/test_iterator.py [64 started in total]
__ module/cpyext/test/test_import.py [61 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/cpyext/test/test_import.py ......
========================== 6 passed in 70.22 seconds ===========================
++ 08:54:07 starting module/cpyext/test/test_listobject.py [65 started in total]
__ module/cpyext/test/test_intobject.py [62 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 10 items
module/cpyext/test/test_intobject.py ..........
========================== 10 passed in 77.66 seconds ==========================
++ 08:54:19 starting module/cpyext/test/test_longobject.py [66 started in total]
__ module/cpyext/test/test_iterator.py [63 done in total, somefailed=False] ___
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 5 items
module/cpyext/test/test_iterator.py ....in sq_inplace_repeat, n=3
.
========================== 5 passed in 66.40 seconds ===========================
++ 08:54:23 starting module/cpyext/test/test_mapping.py [67 started in total]
__ module/cpyext/test/test_getargs.py [64 done in total, somefailed=False] ____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 11 items
module/cpyext/test/test_getargs.py ...........
========================== 11 passed in 93.06 seconds ==========================
++ 08:54:23 starting module/cpyext/test/test_marshal.py [68 started in total]
__ module/cpyext/test/test_listobject.py [65 done in total, somefailed=False] _
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 12 items
module/cpyext/test/test_listobject.py ............
========================== 12 passed in 90.21 seconds ==========================
++ 08:55:56 starting module/cpyext/test/test_memoryobject.py [69 started in total]
__ module/cpyext/test/test_mapping.py [66 done in total, somefailed=False] ____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/cpyext/test/test_mapping.py ......
========================== 6 passed in 76.49 seconds ===========================
++ 08:55:57 starting module/cpyext/test/test_methodobject.py [70 started in total]
__ module/cpyext/test/test_marshal.py [67 done in total, somefailed=False] ____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 2 items
module/cpyext/test/test_marshal.py ..
========================== 2 passed in 80.17 seconds ===========================
++ 08:55:57 starting module/cpyext/test/test_misc.py [71 started in total]
__ module/cpyext/test/test_longobject.py [68 done in total, somefailed=False] _
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 20 items
module/cpyext/test/test_longobject.py ....................
========================= 20 passed in 108.07 seconds ==========================
++ 08:56:23 starting module/cpyext/test/test_module.py [72 started in total]
__ module/cpyext/test/test_misc.py [69 done in total, somefailed=False] _______
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_misc.py .
========================== 1 passed in 76.43 seconds ===========================
++ 08:57:32 starting module/cpyext/test/test_ndarrayobject.py [73 started in total]
__ module/cpyext/test/test_module.py [70 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 2 items
module/cpyext/test/test_module.py ..
========================== 2 passed in 71.95 seconds ===========================
++ 08:57:57 starting module/cpyext/test/test_number.py [74 started in total]
__ module/cpyext/test/test_memoryobject.py [71 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 8 items
module/cpyext/test/test_memoryobject.py .....s..
==================== 7 passed, 1 skipped in 112.66 seconds =====================
++ 08:58:06 starting module/cpyext/test/test_object.py [75 started in total]
__ module/cpyext/test/test_methodobject.py [72 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 11 items
module/cpyext/test/test_methodobject.py ...........
========================= 11 passed in 119.20 seconds ==========================
++ 08:58:15 starting module/cpyext/test/test_pycobject.py [76 started in total]
__ module/cpyext/test/test_ndarrayobject.py [73 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 24 items
module/cpyext/test/test_ndarrayobject.py ........................
========================= 24 passed in 116.39 seconds ==========================
++ 08:59:50 starting module/cpyext/test/test_pyerrors.py [77 started in total]
__ module/cpyext/test/test_pycobject.py [74 done in total, somefailed=True] ___
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_pycobject.py F
=================================== FAILURES ===================================
__________________ AppTestStringObject.test_pycobject_import ___________________
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 0xf7649144>, 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_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pycobject_import'>}
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 0xf7a5932c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4d65e4c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pycobject_import'>}
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 0xf4d65e4c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pycobject_import'>}
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_pycobject_import'>, '__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 0xf422ce64>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ect_import'>, '__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 0xf41e09ec>
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 0xf41e09ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ect_import'>, '__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_pycobject_import'>, '__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 0xf422cf2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ect_import'>, '__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 0xf41e0a2c>
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 0xf41e0a2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ect_import'>, '__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_pycobject_import'>, '__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_pycobject_import'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_pycobject_import'>
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_pycobject_import'>, space = StdObjSpace
target = <function test_pycobject_import at 0xf41bf294>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4c39a8c>)
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 0xf4c39a8c>,)
w_func = <Function test_pycobject_import>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4c39a8c>
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_pycobject_import>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4c39a8c>,)
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_pycobject_import>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4c39a8c>,)
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_pycobject_import, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', 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_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24
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_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24
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_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24
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_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24
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_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24
pycode = <code object test_pycobject_import, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c5c3ec>
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_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24
co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00d\x03\x00g\x02\x00\xca\x02\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x04\x00\xca\x01\...\xcc\x18\x00|\x01\x00\xc9\x07\x00\xca\x00\x00d\x04\x00k\x02\x00st\x00t\x04\x00\x82\x01\x00|\x01\x00`\x03\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c5c3ec>
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_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24
co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00d\x03\x00g\x02\x00\xca\x02\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x04\x00\xca\x01\...\xcc\x18\x00|\x01\x00\xc9\x07\x00\xca\x00\x00d\x04\x00k\x02\x00st\x00t\x04\x00\x82\x01\x00|\x01\x00`\x03\x00d\x00\x00S'
next_instr = 85L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c5c3ec>
@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_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24
nameindex = 6, ignored = (85L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4cab58c>
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 0xf4cab58c>
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 0xf4cab58c>
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
----------------------------- Captured stderr call -----------------------------
<function _Py_InitPyPyModule at 0xf4f69ca4> DONE
<function PyLong_AsVoidPtr at 0xf4ee217c> DONE
<function PyErr_Occurred at 0xf4f4d56c> DONE
<function PyErr_Occurred at 0xf4f4d56c> DONE
<function PyImport_ImportModule at 0xf4f3dd84> DONE
<function check at 0xf4f69aac> DONE
<function PyModule_GetDict at 0xf4f69d84> DONE
<function PyDict_SetItemString at 0xf4e89614> DONE
<function PyErr_Occurred at 0xf4f4d56c> DONE
=========================== short test summary info ============================
FAIL module/cpyext/test/test_pycobject.py::AppTestStringObject::()::test_pycobject_import
========================== 1 failed in 82.84 seconds ===========================
++ 08:59:57 starting module/cpyext/test/test_pyfile.py [78 started in total]
__ module/cpyext/test/test_number.py [75 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 11 items
module/cpyext/test/test_number.py ..........got no exc
got no exc
got exc
.
========================== 11 passed in 99.99 seconds ==========================
++ 09:00:00 starting module/cpyext/test/test_pysignals.py [79 started in total]
__ module/cpyext/test/test_object.py [76 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 35 items
module/cpyext/test/test_object.py ........................s..........
==================== 34 passed, 1 skipped in 135.70 seconds ====================
++ 09:00:38 starting module/cpyext/test/test_pystate.py [80 started in total]
__ module/cpyext/test/test_pysignals.py [77 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_pysignals.py .
========================== 1 passed in 72.60 seconds ===========================
++ 09:01:35 starting module/cpyext/test/test_pystrtod.py [81 started in total]
__ module/cpyext/test/test_pyfile.py [78 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 9 items
module/cpyext/test/test_pyfile.py ....x....
===================== 8 passed, 1 xfailed in 80.26 seconds =====================
++ 09:01:38 starting module/cpyext/test/test_sequence.py [82 started in total]
__ module/cpyext/test/test_pyerrors.py [79 done in total, somefailed=False] ___
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 27 items
module/cpyext/test/test_pyerrors.py .........s.....s........s..
==================== 24 passed, 3 skipped in 143.79 seconds ====================
++ 09:02:29 starting module/cpyext/test/test_setobject.py [83 started in total]
__ module/cpyext/test/test_pystrtod.py [80 done in total, somefailed=False] ___
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 18 items
module/cpyext/test/test_pystrtod.py ..................
========================== 18 passed in 75.48 seconds ==========================
++ 09:03:09 starting module/cpyext/test/test_sliceobject.py [84 started in total]
__ module/cpyext/test/test_pystate.py [81 done in total, somefailed=False] ____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 13 items
module/cpyext/test/test_pystate.py .............
========================= 13 passed in 129.41 seconds ==========================
++ 09:03:10 starting module/cpyext/test/test_structseq.py [85 started in total]
__ module/cpyext/test/test_sequence.py [82 done in total, somefailed=False] ___
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 23 items
module/cpyext/test/test_sequence.py .......................
========================= 23 passed in 111.79 seconds ==========================
++ 09:03:49 starting module/cpyext/test/test_sysmodule.py [86 started in total]
__ module/cpyext/test/test_setobject.py [83 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 9 items
module/cpyext/test/test_setobject.py .........
========================== 9 passed in 79.93 seconds ===========================
++ 09:04:11 starting module/cpyext/test/test_thread.py [87 started in total]
__ module/cpyext/test/test_structseq.py [84 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_structseq.py .
========================== 1 passed in 78.31 seconds ===========================
++ 09:04:45 starting module/cpyext/test/test_traceback.py [88 started in total]
__ module/cpyext/test/test_sliceobject.py [85 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/cpyext/test/test_sliceobject.py ......
========================== 6 passed in 85.50 seconds ===========================
++ 09:04:51 starting module/cpyext/test/test_translate.py [89 started in total]
__ module/cpyext/test/test_translate.py [86 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_translate.py .
========================== 1 passed in 10.43 seconds ===========================
++ 09:05:19 starting module/cpyext/test/test_tupleobject.py [90 started in total]
__ module/cpyext/test/test_sysmodule.py [87 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items
module/cpyext/test/test_sysmodule.py ...
========================== 3 passed in 89.44 seconds ===========================
++ 09:05:38 starting module/cpyext/test/test_typeobject.py [91 started in total]
__ module/cpyext/test/test_traceback.py [88 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/cpyext/test/test_traceback.py .
========================== 1 passed in 68.50 seconds ===========================
++ 09:06:12 starting module/cpyext/test/test_unicodeobject.py [92 started in total]
__ module/cpyext/test/test_thread.py [89 done in total, somefailed=False] _____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 4 items
module/cpyext/test/test_thread.py ....
========================== 4 passed in 103.59 seconds ==========================
++ 09:06:14 starting module/cpyext/test/test_userslots.py [93 started in total]
__ module/cpyext/test/test_tupleobject.py [90 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 10 items
module/cpyext/test/test_tupleobject.py ..........
========================= 10 passed in 108.18 seconds ==========================
++ 09:07:29 starting module/cpyext/test/test_version.py [94 started in total]
__ module/cpyext/test/test_userslots.py [91 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module/cpyext/test/test_userslots.py ......
========================== 6 passed in 109.38 seconds ==========================
++ 09:08:24 starting module/cpyext/test/test_weakref.py [95 started in total]
__ module/cpyext/test/test_unicodeobject.py [92 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 47 items
module/cpyext/test/test_unicodeobject.py .............................s.................
==================== 46 passed, 1 skipped in 139.09 seconds ====================
++ 09:08:51 starting module/crypt/test [96 started in total]
__ module/crypt/test [93 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module/crypt/test/test_crypt.py .
========================== 1 passed in 10.09 seconds ===========================
++ 09:09:04 starting module/errno/test [97 started in total]
__ module/cpyext/test/test_version.py [94 done in total, somefailed=False] ____
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items
module/cpyext/test/test_version.py ...
========================== 3 passed in 79.96 seconds ===========================
++ 09:09:11 starting module/exceptions/test [98 started in total]
__ module/errno/test [95 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items
module/errno/test/test_errno.py ...
=========================== 3 passed in 9.48 seconds ===========================
++ 09:09:16 starting module/faulthandler/test [99 started in total]
__ module/exceptions/test [96 done in total, somefailed=False] ________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 24 items
module/exceptions/test/test_exc.py ..........s.............
==================== 23 passed, 1 skipped in 22.71 seconds =====================
++ 09:09:39 starting module/fcntl/test [100 started in total]
__ module/faulthandler/test [97 done in total, somefailed=False] ______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items
module/faulthandler/test/test_faulthander.py ..
module/faulthandler/test/test_ztranslation.py .
========================== 3 passed in 19.32 seconds ===========================
++ 09:09:40 starting module/gc/test [101 started in total]
__ module/gc/test [98 done in total, somefailed=True] _________________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 13 items / 2 errors
module/gc/test/test_app_referents.py ....
module/gc/test/test_referents.py ........
module/gc/test/test_ztranslation.py F
==================================== ERRORS ====================================
_______________ ERROR collecting pypy/module/gc/test/test_gc.py ________________
../_pytest/python.py:611: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
../py/_path/local.py:650: in pyimport
__import__(modname)
module/gc/test/test_gc.py:6: in <module>
from pypy.module.gc.interp_gc import StepCollector, W_GcCollectStepStats
module/gc/interp_gc.py:4: in <module>
from pypy.module.gc.hook import W_GcCollectStepStats
module/gc/hook.py:2: in <module>
from rpython.memory.gc import incminimark
../rpython/memory/gc/incminimark.py:70: in <module>
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
______________ ERROR collecting pypy/module/gc/test/test_hook.py _______________
../_pytest/python.py:611: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
../py/_path/local.py:650: in pyimport
__import__(modname)
module/gc/test/test_hook.py:3: in <module>
from pypy.module.gc.hook import LowLevelGcHooks
module/gc/hook.py:2: in <module>
from rpython.memory.gc import incminimark
../rpython/memory/gc/incminimark.py:70: in <module>
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
=================================== FAILURES ===================================
_______________________________ test_checkmodule _______________________________
def test_checkmodule():
# we need to ignore GcCollectStepStats, else checkmodule fails. I think
# this happens because W_GcCollectStepStats.__init__ is only called from
# GcCollectStepHookAction.perform() and the fake objspace doesn't know
# about those: so, perform() is never annotated and the annotator thinks
# W_GcCollectStepStats has no attributes
> checkmodule('gc', ignore=['GcCollectStepStats'])
module/gc/test/test_ztranslation.py:9:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
objspace/fake/checkmodule.py:23: in checkmodule
seeobj_w.append(module._load_lazily(space, name))
interpreter/mixedmodule.py:103: in _load_lazily
w_value = loader(space)
interpreter/mixedmodule.py:182: in ifileloader
d[name] = __import__(pkgroot+'.'+name, None, None, [name])
module/gc/interp_gc.py:4: in <module>
from pypy.module.gc.hook import W_GcCollectStepStats
module/gc/hook.py:2: in <module>
from rpython.memory.gc import incminimark
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"""
# 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
=========================== short test summary info ============================
FAIL module/gc/test/test_ztranslation.py::test_checkmodule
================ 1 failed, 12 passed, 2 error in 17.24 seconds =================
++ 09:10:00 starting module/imp/test [102 started in total]
__ module/fcntl/test [99 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 8 items
module/fcntl/test/test_fcntl.py ........
========================== 8 passed in 26.30 seconds ===========================
++ 09:10:07 starting module/itertools/test [103 started in total]
__ module/cpyext/test/test_weakref.py [100 done in total, somefailed=False] ___
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 5 items
module/cpyext/test/test_weakref.py .....
========================== 5 passed in 85.54 seconds ===========================
++ 09:10:13 starting module/marshal/test [104 started in total]
__ module/marshal/test [101 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 80 items
module/marshal/test/test_marshal.py ...................................................................
module/marshal/test/test_marshalimpl.py .............
========================== 80 passed in 39.69 seconds ==========================
++ 09:10:57 starting module/math/test [105 started in total]
__ module/math/test [102 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 182 items
module/math/test/test_direct.py ......................................................................................................................................................................
module/math/test/test_factorial.py .s
module/math/test/test_math.py ..s......s....
==================== 179 passed, 3 skipped in 35.04 seconds ====================
++ 09:11:35 starting module/micronumpy/test [106 started in total]
__ module/itertools/test [103 done in total, somefailed=True] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 73 items
module/itertools/test/test_itertools.py .................F......................................................
module/itertools/test/test_ztranslation.py .
=================================== FAILURES ===================================
_________________________ AppTestItertools.test_islice _________________________
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 0xf4f2af7c>, 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_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_islice'>}
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 0xf7a1532c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69b24cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_islice'>}
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 0xf69b24cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_islice'>}
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_islice'>, '__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 0xf4f914dc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_islice'>, '__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 0xf4f314ec>
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 0xf4f314ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_islice'>, '__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_islice'>, '__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 0xf4f91e3c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_islice'>, '__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 0xf4f3188c>
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 0xf4f3188c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_islice'>, '__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_islice'>, '__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_islice'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_islice'>
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_islice'>, space = StdObjSpace
target = <function test_islice at 0xf4f2a5a4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf509c8cc>)
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 0xf509c8cc>,)
w_func = <Function test_islice>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf509c8cc>
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_islice>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf509c8cc>,)
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_islice>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf509c8cc>,)
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_islice, file '[/build_dir/own-linux-x86-32/build/pypy/module/itertools/test/test_itertools.py:204]', 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_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52
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_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52
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_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52
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_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52
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_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52
pycode = <code object test_islice, file '[/build_dir/own-linux-x86-32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1>
next_instr = 549
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50ad70c>
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_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00g\x00\x00d\x02\x00\xca\x02\x00}\x02\x00t\x02\x00t\x03\x00|\x...0d\x00\x00k\x08\x00s\xcf\x03t\x05\x00\x82\x01\x00t\x02\x00t\x03\x00t\x04\x00|\x02\x00\x83\x03\x00\x01qH\x03Wd\x00\x00S'
next_instr = 549
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50ad70c>
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_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00g\x00\x00d\x02\x00\xca\x02\x00}\x02\x00t\x02\x00t\x03\x00|\x...0d\x00\x00k\x08\x00s\xcf\x03t\x05\x00\x82\x01\x00t\x02\x00t\x03\x00t\x04\x00|\x02\x00\x83\x03\x00\x01qH\x03Wd\x00\x00S'
next_instr = 947L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50ad70c>
@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_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52
nameindex = 12, ignored = (947L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52ceb0c>
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 0xf52ceb0c>
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 0xf52ceb0c>
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
=========================== short test summary info ============================
FAIL module/itertools/test/test_itertools.py::AppTestItertools::()::test_islice
==================== 1 failed, 72 passed in 102.29 seconds =====================
++ 09:11:56 starting module/mmap/test [107 started in total]
__ module/mmap/test [104 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 43 items
module/mmap/test/test_mmap.py ......................s..............ss....
==================== 40 passed, 3 skipped in 94.29 seconds =====================
++ 09:13:38 starting module/operator/test [108 started in total]
__ module/operator/test [105 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 27 items
module/operator/test/test_operator.py ..................
module/operator/test/test_tscmp.py .........
========================== 27 passed in 22.12 seconds ==========================
++ 09:14:05 starting module/parser/test [109 started in total]
__ module/parser/test [106 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 7 items
module/parser/test/test_parser.py .......
========================== 7 passed in 17.56 seconds ===========================
++ 09:14:26 starting module/posix/test [110 started in total]
__ module/imp/test [107 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 124 items
module/imp/test/test_app.py ................
module/imp/test/test_import.py ..............................s.........................................................s...................
=================== 122 passed, 2 skipped in 345.21 seconds ====================
++ 09:15:54 starting module/pwd/test [111 started in total]
__ module/pwd/test [108 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 4 items
module/pwd/test/test_pwd.py ...
module/pwd/test/test_ztranslation.py .
========================== 4 passed in 33.87 seconds ===========================
++ 09:16:32 starting module/pyexpat/test [112 started in total]
__ module/posix/test [109 done in total, somefailed=True] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 108 items
module/posix/test/test_posix2.py .............................FFF...............................s...........s.........s................s
module/posix/test/test_posix_libfile.py ..FF
module/posix/test/test_ztranslation.py .
=================================== FAILURES ===================================
___________________________ AppTestPosix.test_popen ____________________________
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 0xf4967a04>, 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_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>}
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 0xf7a0332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>}
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 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>}
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_popen'>, '__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 0xf4983d9c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__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 0xf491b38c>
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 0xf491b38c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__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_popen'>, '__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 0xf4d9ae64>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__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 0xf491b8ac>
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 0xf491b8ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__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_popen'>, '__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_popen'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_popen'>
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_popen'>, space = StdObjSpace
target = <function test_popen at 0xf493009c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>)
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 0xf4f3b3cc>,)
w_func = <Function test_popen>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>
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_popen>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>,)
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_popen>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>,)
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_popen, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', 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_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
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_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
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_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
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_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
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_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
pycode = <code object test_popen, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
co_code = '|\x00\x00j\x00\x00}\x01\x00x_\x00t\x01\x00d\x01\x00\x83\x01\x00D]Q\x00}\x02\x00|\x01\x00\xc9\x02\x00d\x02\x00\xca\x01...|\x03\x00\xc9\x05\x00\xca\x00\x00d\x00\x00k\x08\x00sg\x00t\x04\x00\x82\x01\x00q\x16\x00Wd\x00\x00Sq\x16\x00Wd\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
co_code = '|\x00\x00j\x00\x00}\x01\x00x_\x00t\x01\x00d\x01\x00\x83\x01\x00D]Q\x00}\x02\x00|\x01\x00\xc9\x02\x00d\x02\x00\xca\x01...|\x03\x00\xc9\x05\x00\xca\x00\x00d\x00\x00k\x08\x00sg\x00t\x04\x00\x82\x01\x00q\x16\x00Wd\x00\x00Sq\x16\x00Wd\x00\x00S'
next_instr = 40L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
oparg = 1, ignored = (40L,), n_args = 1, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
dropvalues = 3, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
dropvalues = 3, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
return self._flat_pycall(code, nargs, frame, dropvalues)
elif fast_natural_arity & Code.FLATPYCALL:
natural_arity = fast_natural_arity & 0xff
if natural_arity > nargs >= natural_arity - len(self.defs_w):
assert isinstance(code, PyCode)
return self._flat_pycall_defaults(code, nargs, frame,
> natural_arity - nargs, dropvalues)
interpreter/function.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>
code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4
defs_to_load = 2, dropvalues = 3
@jit.unroll_safe
def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
ndefs = len(self.defs_w)
start = ndefs - defs_to_load
i = nargs
for j in xrange(start, ndefs):
new_frame.locals_cells_stack_w[i] = self.defs_w[j]
i += 1
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 115L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
@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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
nameindex = 5, ignored = (115L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf518124c>
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 0xf518124c>
space = StdObjSpace, name = 'disable_finalizers'
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 0xf518124c>
space = StdObjSpace, name = 'disable_finalizers'
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
_________________________ AppTestPosix.test_popen_with _________________________
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 0xf49c064c>, 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_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_with'>}
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 0xf7a0332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_with'>}
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 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_with'>}
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_popen_with'>, '__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 0xf49f8c0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...popen_with'>, '__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 0xf4a3ecac>
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 0xf4a3ecac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...popen_with'>, '__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_popen_with'>, '__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 0xf49f820c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...popen_with'>, '__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 0xf4a3ecec>
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 0xf4a3ecec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...popen_with'>, '__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_popen_with'>, '__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_popen_with'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_popen_with'>
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_popen_with'>, space = StdObjSpace
target = <function test_popen_with at 0xf4a013ac>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>)
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 0xf4f3b3cc>,)
w_func = <Function test_popen_with>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>
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_popen_with>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>,)
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_popen_with>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>,)
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_popen_with, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', 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_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
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_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
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_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
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_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
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_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
pycode = <code object test_popen_with, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
co_code = '|\x00\x00j\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x01\x00\xca\x01\x00}\x02\x00|\x02\x00\x8f(\x00}\x03\x00|\x03\x00\xc9\x02\x00\xca\x00\x00}\x04\x00\xcc\x12\x00|\x04\x00d\x02\x00k\x02\x00sB\x00t\x03\x00\x82\x01\x00Wd\x00\x00QXd\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
co_code = '|\x00\x00j\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x01\x00\xca\x01\x00}\x02\x00|\x02\x00\x8f(\x00}\x03\x00|\x03\x00\xc9\x02\x00\xca\x00\x00}\x04\x00\xcc\x12\x00|\x04\x00d\x02\x00k\x02\x00sB\x00t\x03\x00\x82\x01\x00Wd\x00\x00QXd\x00\x00S'
next_instr = 21L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
oparg = 1, ignored = (21L,), n_args = 1, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
dropvalues = 3, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
dropvalues = 3, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
return self._flat_pycall(code, nargs, frame, dropvalues)
elif fast_natural_arity & Code.FLATPYCALL:
natural_arity = fast_natural_arity & 0xff
if natural_arity > nargs >= natural_arity - len(self.defs_w):
assert isinstance(code, PyCode)
return self._flat_pycall_defaults(code, nargs, frame,
> natural_arity - nargs, dropvalues)
interpreter/function.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>
code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3
defs_to_load = 2, dropvalues = 3
@jit.unroll_safe
def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
ndefs = len(self.defs_w)
start = ndefs - defs_to_load
i = nargs
for j in xrange(start, ndefs):
new_frame.locals_cells_stack_w[i] = self.defs_w[j]
i += 1
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 115L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
@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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
nameindex = 5, ignored = (115L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf518124c>
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 0xf518124c>
space = StdObjSpace, name = 'disable_finalizers'
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 0xf518124c>
space = StdObjSpace, name = 'disable_finalizers'
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
______________________ AppTestPosix.test_popen_child_fds _______________________
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 0xf48cd4c4>, 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_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_child_fds'>}
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 0xf7a0332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_child_fds'>}
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 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_child_fds'>}
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_popen_child_fds'>, '__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 0xf4979e3c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._child_fds'>, '__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 0xf47546ac>
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 0xf47546ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._child_fds'>, '__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_popen_child_fds'>, '__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 0xf49125f4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._child_fds'>, '__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 0xf47546ec>
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 0xf47546ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._child_fds'>, '__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_popen_child_fds'>, '__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_popen_child_fds'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_popen_child_fds'>
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_popen_child_fds'>, space = StdObjSpace
target = <function test_popen_child_fds at 0xf4847dbc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>)
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 0xf4f3b3cc>,)
w_func = <Function test_popen_child_fds>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>
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_popen_child_fds>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>,)
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_popen_child_fds>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f3b3cc>,)
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_popen_child_fds, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', 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_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
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_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
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_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
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_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
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_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
pycode = <code object test_popen_child_fds, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
co_code = '|\x00\x00j\x00\x00}\x01\x00t\x01\x00d\x01\x00\xc9\x02\x00|\x00\x00j\x03\x00d\x02\x00g\x02\x00\xca\x01\x00d\x03\x00\x8...\x01\x00n\x15\x00\xcc\x12\x00|\x04\x00d\x07\x00k\x02\x00s\x9d\x00t\t\x00\x82\x01\x00Wd\x00\x00QXWd\x00\x00QXd\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
co_code = '|\x00\x00j\x00\x00}\x01\x00t\x01\x00d\x01\x00\xc9\x02\x00|\x00\x00j\x03\x00d\x02\x00g\x02\x00\xca\x01\x00d\x03\x00\x8...\x01\x00n\x15\x00\xcc\x12\x00|\x04\x00d\x07\x00k\x02\x00s\x9d\x00t\t\x00\x82\x01\x00Wd\x00\x00QXWd\x00\x00QXd\x00\x00S'
next_instr = 79L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
oparg = 1, ignored = (79L,), n_args = 1, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
dropvalues = 3, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
dropvalues = 3, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
return self._flat_pycall(code, nargs, frame, dropvalues)
elif fast_natural_arity & Code.FLATPYCALL:
natural_arity = fast_natural_arity & 0xff
if natural_arity > nargs >= natural_arity - len(self.defs_w):
assert isinstance(code, PyCode)
return self._flat_pycall_defaults(code, nargs, frame,
> natural_arity - nargs, dropvalues)
interpreter/function.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>
code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4
defs_to_load = 2, dropvalues = 3
@jit.unroll_safe
def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
ndefs = len(self.defs_w)
start = ndefs - defs_to_load
i = nargs
for j in xrange(start, ndefs):
new_frame.locals_cells_stack_w[i] = self.defs_w[j]
i += 1
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 115L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f60dec>
@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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
nameindex = 5, ignored = (115L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf518124c>
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 0xf518124c>
space = StdObjSpace, name = 'disable_finalizers'
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 0xf518124c>
space = StdObjSpace, name = 'disable_finalizers'
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
___________________________ AppTestPosix.test_popen ____________________________
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 0xf4464224>, 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_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>}
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 0xf7a0332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>}
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 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>}
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_popen'>, '__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 0xf47fde64>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__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 0xf47e56ac>
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 0xf47e56ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__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_popen'>, '__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 0xf47fda04>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__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 0xf47e578c>
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 0xf47e578c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__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_popen'>, '__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_popen'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_popen'>
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_popen'>, space = StdObjSpace
target = <function test_popen at 0xf41a1224>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf41b30ac>)
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 0xf41b30ac>,)
w_func = <Function test_popen>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf41b30ac>
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_popen>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf41b30ac>,)
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_popen>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf41b30ac>,)
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_popen, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', 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_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
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_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
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_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
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_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
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_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
pycode = <code object test_popen, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
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_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00j\x01\x00\xc9\x02\x00d\x02\x00\xca\x01\x00r+\x00t\x03\x00d\x03\x00\x83\x...c9\x0c\x00\xca\x00\x00}\x08\x00\xcc\x16\x00|\x08\x00|\x07\x00\x18d\x0c\x00k\x05\x00s;\x01t\t\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
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_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00j\x01\x00\xc9\x02\x00d\x02\x00\xca\x01\x00r+\x00t\x03\x00d\x03\x00\x83\x...c9\x0c\x00\xca\x00\x00}\x08\x00\xcc\x16\x00|\x08\x00|\x07\x00\x18d\x0c\x00k\x05\x00s;\x01t\t\x00\x82\x01\x00d\x00\x00S'
next_instr = 77L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
oparg = 1, ignored = (77L,), n_args = 1, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
dropvalues = 3, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
dropvalues = 3, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
return self._flat_pycall(code, nargs, frame, dropvalues)
elif fast_natural_arity & Code.FLATPYCALL:
natural_arity = fast_natural_arity & 0xff
if natural_arity > nargs >= natural_arity - len(self.defs_w):
assert isinstance(code, PyCode)
return self._flat_pycall_defaults(code, nargs, frame,
> natural_arity - nargs, dropvalues)
interpreter/function.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>
code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8
defs_to_load = 2, dropvalues = 3
@jit.unroll_safe
def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
ndefs = len(self.defs_w)
start = ndefs - defs_to_load
i = nargs
for j in xrange(start, ndefs):
new_frame.locals_cells_stack_w[i] = self.defs_w[j]
i += 1
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 115L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
@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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
nameindex = 5, ignored = (115L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf41fb02c>
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 0xf41fb02c>
space = StdObjSpace, name = 'disable_finalizers'
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 0xf41fb02c>
space = StdObjSpace, name = 'disable_finalizers'
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
____________ AppTestPosix.test_popen_and_rebind_file_in___builtin__ ____________
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 0xf410e2cc>, 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_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>}
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 0xf7a0332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>}
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 0xf69a04cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>}
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_popen_and_rebind_file_in___builtin__'>, '__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 0xf450fbbc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._builtin__'>, '__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 0xf453b96c>
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 0xf453b96c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._builtin__'>, '__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_popen_and_rebind_file_in___builtin__'>, '__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 0xf450fb1c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._builtin__'>, '__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 0xf453b98c>
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 0xf453b98c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._builtin__'>, '__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_popen_and_rebind_file_in___builtin__'>, '__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_popen_and_rebind_file_in___builtin__'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>
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_popen_and_rebind_file_in___builtin__'>
space = StdObjSpace
target = <function test_popen_and_rebind_file_in___builtin__ at 0xf4549df4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf41b30ac>)
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 0xf41b30ac>,)
w_func = <Function test_popen_and_rebind_file_in___builtin__>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf41b30ac>
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_popen_and_rebind_file_in___builtin__>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf41b30ac>,)
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_popen_and_rebind_file_in___builtin__>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf41b30ac>,)
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_popen_and_rebind_file_in___builtin__, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', 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_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
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_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
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_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
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_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
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_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
pycode = <code object test_popen_and_rebind_file_in___builtin__, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
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_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00j\x01\x00\xc9\x02\x00d\x02\x00\xca\x01\x00r+\x00t\x03\x00d\x03\x00\x83\x...x00\x84\x00\x00|\x02\x00_\x06\x00|\x05\x00\xc9\x08\x00\xca\x00\x00\x01Wd\x00\x00|\x04\x00|\x02\x00_\x06\x00Xd\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
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_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00j\x01\x00\xc9\x02\x00d\x02\x00\xca\x01\x00r+\x00t\x03\x00d\x03\x00\x83\x...x00\x84\x00\x00|\x02\x00_\x06\x00|\x05\x00\xc9\x08\x00\xca\x00\x00\x01Wd\x00\x00|\x04\x00|\x02\x00_\x06\x00Xd\x00\x00S'
next_instr = 85L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
@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)
interpreter/pyopcode.py:276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
oparg = 1, ignored = (85L,), n_args = 1, n_kwargs = 0, w_self = None
@jit.unroll_safe
def CALL_METHOD(f, oparg, *ignored):
# opargs contains the arg, and kwarg count, excluding the implicit 'self'
n_args = oparg & 0xff
n_kwargs = (oparg >> 8) & 0xff
w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs))
n = n_args + (w_self is not None)
if not n_kwargs:
w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1)
w_result = f.space.call_valuestack(
> w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2)
objspace/std/callmethod.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
dropvalues = 3, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
dropvalues = 3, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
return self._flat_pycall(code, nargs, frame, dropvalues)
elif fast_natural_arity & Code.FLATPYCALL:
natural_arity = fast_natural_arity & 0xff
if natural_arity > nargs >= natural_arity - len(self.defs_w):
assert isinstance(code, PyCode)
return self._flat_pycall_defaults(code, nargs, frame,
> natural_arity - nargs, dropvalues)
interpreter/function.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <BuiltinFunction popen>
code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10
defs_to_load = 2, dropvalues = 3
@jit.unroll_safe
def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
ndefs = len(self.defs_w)
start = ndefs - defs_to_load
i = nargs
for j in xrange(start, ndefs):
new_frame.locals_cells_stack_w[i] = self.defs_w[j]
i += 1
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S'
next_instr = 115L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf49a9dcc>
@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 popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173
nameindex = 5, ignored = (115L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf41fb02c>
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 0xf41fb02c>
space = StdObjSpace, name = 'disable_finalizers'
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 0xf41fb02c>
space = StdObjSpace, name = 'disable_finalizers'
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
=========================== short test summary info ============================
FAIL module/posix/test/test_posix2.py::AppTestPosix::()::test_popen
FAIL module/posix/test/test_posix2.py::AppTestPosix::()::test_popen_with
FAIL module/posix/test/test_posix2.py::AppTestPosix::()::test_popen_child_fds
FAIL module/posix/test/test_posix_libfile.py::AppTestPosix::()::test_popen
FAIL module/posix/test/test_posix_libfile.py::AppTestPosix::()::test_popen_and_rebind_file_in___builtin__
=============== 5 failed, 99 passed, 4 skipped in 284.22 seconds ===============
++ 09:19:15 starting module/pypyjit/test [113 started in total]
__ module/pyexpat/test [110 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 21 items
module/pyexpat/test/test_build.py .
module/pyexpat/test/test_parser.py ....................
========================= 21 passed in 165.91 seconds ==========================
++ 09:19:25 starting module/select/test [114 started in total]
__ module/pypyjit/test [111 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 29 items
module/pypyjit/test/test_jit_hook.py ........s
module/pypyjit/test/test_jit_not_in_trace.py ..
module/pypyjit/test/test_jit_setup.py ....
module/pypyjit/test/test_policy.py ............
module/pypyjit/test/test_pyframe.py .
module/pypyjit/test/test_ztranslation.py .
==================== 28 passed, 1 skipped in 47.86 seconds =====================
++ 09:20:06 starting module/signal/test [115 started in total]
__ module/select/test [112 done in total, somefailed=True] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 41 items
module/select/test/test_epoll.py ......F.
module/select/test/test_kqueue.py sssss
module/select/test/test_select.py .....FF.............FF.....
module/select/test/test_ztranslation.py .
=================================== FAILURES ===================================
_____________________ AppTestEpoll.test_unregister_closed ______________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50debec>
def test_unregister_closed(self):
import select
import time
client, server = self.socket_pair()
fd = server.fileno()
ep = select.epoll(16)
ep.register(server)
now = time.time()
ep.poll(1, 4)
then = time.time()
> assert then - now < self.timeout
E (application-level) AssertionError: assert (1780046408.069493 - 1780046408.048418) < 0.02
E + where 0.02 = 0.02
E + where 0.02 = <AppTestEpoll object at 0xf50debec>.timeout
[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_epoll.py:188]:14: AssertionError
___________________ AppTestSelectWithPipes.test_write_close ____________________
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 0xf4bc0ed4>, 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_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>}
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 0xf7a6332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a004cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>}
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 0xf6a004cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>}
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_write_close'>, '__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 0xf4bc9874>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__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 0xf4a19a4c>
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 0xf4a19a4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__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_write_close'>, '__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 0xf4bd0aa4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__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 0xf4a1960c>
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 0xf4a1960c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__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_write_close'>, '__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_write_close'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_write_close'>
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_write_close'>, space = StdObjSpace
target = <function test_write_close at 0xf4a1e844>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4b4838c>)
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 0xf4b4838c>,)
w_func = <Function test_write_close>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4b4838c>
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_write_close>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4b4838c>,)
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_write_close>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4b4838c>,)
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_write_close, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16
pycode = <code object test_write_close, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bd8cac>
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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00\xc9\x02\x00\xca\x00\x00\\\x02\x00}\...x00|\x07\x00|\x05\x00k\x02\x00s\xa1\x01t\x08\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x05\x00\xca\x00\x00\x01Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bd8cac>
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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00\xc9\x02\x00\xca\x00\x00\\\x02\x00}\...x00|\x07\x00|\x05\x00k\x02\x00s\xa1\x01t\x08\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x05\x00\xca\x00\x00\x01Xd\x02\x00S'
next_instr = 114L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bd8cac>
@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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16
nameindex = 7, ignored = (114L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4b722ec>
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 0xf4b722ec>
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 0xf4b722ec>
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
___________________ AppTestSelectWithPipes.test_read_closed ____________________
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 0xf4bcfb54>, 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_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>}
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 0xf7a6332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a004cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>}
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 0xf6a004cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>}
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_read_closed'>, '__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 0xf4bc952c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__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 0xf449d58c>
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 0xf449d58c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__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_read_closed'>, '__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 0xf4bc9694>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__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 0xf449d5cc>
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 0xf449d5cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__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_read_closed'>, '__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_read_closed'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_read_closed'>
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_read_closed'>, space = StdObjSpace
target = <function test_read_closed at 0xf46442cc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4b4838c>)
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 0xf4b4838c>,)
w_func = <Function test_read_closed>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4b4838c>
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_read_closed>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4b4838c>,)
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_read_closed>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4b4838c>,)
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_read_closed, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:138]', 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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
pycode = <code object test_read_closed, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bd8cac>
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\\\x02\x00}\x02\x00}\x03\x00z\x85\x00|\x02\x00\x...\x00k\x02\x00n\x02\x00\x02\x01s\xa2\x00t\x05\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x02\x00\xca\x00\x00\x01Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bd8cac>
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\\\x02\x00}\x02\x00}\x03\x00z\x85\x00|\x02\x00\x...\x00k\x02\x00n\x02\x00\x02\x01s\xa2\x00t\x05\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x02\x00\xca\x00\x00\x01Xd\x02\x00S'
next_instr = 61L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bd8cac>
@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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
nameindex = 4, ignored = (61L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4b722ec>
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 0xf4b722ec>
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 0xf4b722ec>
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
__________________ AppTestSelectWithSockets.test_write_close ___________________
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 0xf4b8ef0c>, 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_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>}
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 0xf7a6332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a004cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>}
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 0xf6a004cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>}
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_write_close'>, '__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 0xf4720c5c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__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 0xf447c82c>
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 0xf447c82c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__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_write_close'>, '__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 0xf449157c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__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 0xf447c58c>
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 0xf447c58c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__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_write_close'>, '__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_write_close'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_write_close'>
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_write_close'>, space = StdObjSpace
target = <function test_write_close at 0xf497ddbc>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf443ca8c>)
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 0xf443ca8c>,)
w_func = <Function test_write_close>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf443ca8c>
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_write_close>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf443ca8c>,)
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_write_close>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf443ca8c>,)
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_write_close, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', 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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16
pycode = <code object test_write_close, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4b13fac>
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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00\xc9\x02\x00\xca\x00\x00\\\x02\x00}\...x00|\x07\x00|\x05\x00k\x02\x00s\xa1\x01t\x08\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x05\x00\xca\x00\x00\x01Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4b13fac>
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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00\xc9\x02\x00\xca\x00\x00\\\x02\x00}\...x00|\x07\x00|\x05\x00k\x02\x00s\xa1\x01t\x08\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x05\x00\xca\x00\x00\x01Xd\x02\x00S'
next_instr = 114L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4b13fac>
@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_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16
nameindex = 7, ignored = (114L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4ba790c>
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 0xf4ba790c>
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 0xf4ba790c>
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
__________________ AppTestSelectWithSockets.test_read_closed ___________________
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 0xf422941c>, 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_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>}
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 0xf7a6332c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a004cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>}
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 0xf6a004cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>}
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_read_closed'>, '__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 0xf492dcd4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__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 0xf388e7ac>
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 0xf388e7ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__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_read_closed'>, '__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 0xf492d0cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__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 0xf388e80c>
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 0xf388e80c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__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_read_closed'>, '__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_read_closed'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_read_closed'>
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_read_closed'>, space = StdObjSpace
target = <function test_read_closed at 0xf422cc6c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf443ca8c>)
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 0xf443ca8c>,)
w_func = <Function test_read_closed>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf443ca8c>
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_read_closed>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf443ca8c>,)
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_read_closed>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf443ca8c>,)
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_read_closed, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:138]', 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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
pycode = <code object test_read_closed, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4b13fac>
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\\\x02\x00}\x02\x00}\x03\x00z\x85\x00|\x02\x00\x...\x00k\x02\x00n\x02\x00\x02\x01s\xa2\x00t\x05\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x02\x00\xca\x00\x00\x01Xd\x02\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4b13fac>
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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\\\x02\x00}\x02\x00}\x03\x00z\x85\x00|\x02\x00\x...\x00k\x02\x00n\x02\x00\x02\x01s\xa2\x00t\x05\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x02\x00\xca\x00\x00\x01Xd\x02\x00S'
next_instr = 61L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4b13fac>
@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_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11
nameindex = 4, ignored = (61L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf4ba790c>
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 0xf4ba790c>
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 0xf4ba790c>
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
=========================== short test summary info ============================
FAIL module/select/test/test_epoll.py::AppTestEpoll::()::test_unregister_closed
FAIL module/select/test/test_select.py::AppTestSelectWithPipes::()::test_write_close
FAIL module/select/test/test_select.py::AppTestSelectWithPipes::()::test_read_closed
FAIL module/select/test/test_select.py::AppTestSelectWithSockets::()::test_write_close
FAIL module/select/test/test_select.py::AppTestSelectWithSockets::()::test_read_closed
=============== 5 failed, 31 passed, 5 skipped in 114.69 seconds ===============
++ 09:21:29 starting module/struct/test [116 started in total]
__ module/signal/test [113 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 18 items
module/signal/test/test_signal.py ..................
========================== 18 passed in 88.70 seconds ==========================
++ 09:21:41 starting module/sys/test [117 started in total]
__ module/cpyext/test/test_typeobject.py [114 done in total, somefailed=False]
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 68 items
module/cpyext/test/test_typeobject.py ...............s................................................s...
==================== 66 passed, 2 skipped in 950.66 seconds ====================
++ 09:21:51 starting module/termios/test [118 started in total]
__ module/termios/test [115 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 8 items
module/termios/test/test_termios.py sssss...
===================== 3 passed, 5 skipped in 31.29 seconds =====================
++ 09:22:29 starting module/test_lib_pypy [119 started in total]
__ module/sys/test [116 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 65 items
module/sys/test/apptest_initpath.py .
module/sys/test/test_encoding.py .
module/sys/test/test_initpath.py .......
module/sys/test/test_sysmodule.py ...............................s....................
module/sys/test/test_version.py ....
==================== 64 passed, 1 skipped in 48.90 seconds =====================
++ 09:22:32 starting module/thread/test [120 started in total]
__ module/struct/test [117 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 41 items
module/struct/test/test_struct.py ........................................
module/struct/test/test_ztranslation.py .
========================== 41 passed in 71.17 seconds ==========================
++ 09:22:49 starting module/time/test [121 started in total]
__ module/time/test [118 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 18 items
module/time/test/test_time.py ..................
========================= 18 passed in 103.36 seconds ==========================
++ 09:24:38 starting module/unicodedata/test [122 started in total]
__ module/thread/test [119 done in total, somefailed=True] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 48 items
module/thread/test/test_fork.py s..
module/thread/test/test_gil.py ..FF
module/thread/test/test_import_lock.py .....
module/thread/test/test_local.py F....F.
module/thread/test/test_lock.py .................
module/thread/test/test_thread.py .F..........
=================================== FAILURES ===================================
______________________ TestUsingFramework.test_one_thread ______________________
self = <pypy.module.thread.test.test_gil.TestUsingFramework object at 0xf4c73c4c>
skew = 25000
def test_one_thread(self, skew=+1):
from rpython.rlib.debug import debug_print
if self.bigtest:
N = 100000
skew *= 25000
else:
N = 100
skew *= 25
space = FakeSpace()
class State:
pass
state = State()
def runme(main=False):
j = 0
for i in range(N + [-skew, skew][main]):
state.datalen1 += 1 # try to crash if the GIL is not
state.datalen2 += 1 # correctly acquired
state.data.append((thread.get_ident(), i))
state.datalen3 += 1
state.datalen4 += 1
assert state.datalen1 == len(state.data)
assert state.datalen2 == len(state.data)
assert state.datalen3 == len(state.data)
assert state.datalen4 == len(state.data)
debug_print(main, i, state.datalen4)
rgil.yield_thread()
assert i == j
j += 1
def bootstrap():
try:
runme()
except Exception as e:
assert 0
thread.gc_thread_die()
my_gil_threadlocals = gil.GILThreadLocals(space)
def f():
state.data = []
state.datalen1 = 0
state.datalen2 = 0
state.datalen3 = 0
state.datalen4 = 0
state.threadlocals = my_gil_threadlocals
state.threadlocals.setup_threads(space)
subident = thread.start_new_thread(bootstrap, ())
mainident = thread.get_ident()
runme(True)
still_waiting = 3000
while len(state.data) < 2*N:
debug_print(len(state.data))
if not still_waiting:
llop.debug_print(lltype.Void, "timeout. progress: "
"%d of %d (= %f%%)" % \
(len(state.data), 2*N, 100*len(state.data)/(2.0*N)))
raise ValueError("time out")
still_waiting -= 1
if not we_are_translated(): rgil.release()
time.sleep(0.1)
if not we_are_translated(): rgil.acquire()
debug_print("leaving!")
i1 = i2 = 0
for tid, i in state.data:
if tid == mainident:
assert i == i1; i1 += 1
elif tid == subident:
assert i == i2; i2 += 1
else:
assert 0
assert i1 == N + skew
assert i2 == N - skew
return len(state.data)
> fn = self.getcompiled(f, [])
module/thread/test/test_gil.py:107:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../rpython/translator/c/test/test_boehm.py:40: in getcompiled
thread=self.use_threads, **extra_options)
../rpython/translator/c/test/test_genc.py:124: in compile
t.compile_c()
../rpython/translator/interactive.py:123: in compile_c
self.driver.compile_c()
../rpython/translator/driver.py:108: in proc
return self.proceed(backend_goal)
../rpython/translator/driver.py:568: in proceed
result = self._execute(goals, task_skip = self._maybe_skip())
../rpython/translator/tool/taskengine.py:114: in _execute
res = self._do(goal, taskcallable, *args, **kwds)
../rpython/translator/driver.py:278: in _do
res = func()
../rpython/translator/driver.py:435: in task_database_c
database = cbuilder.build_database()
../rpython/translator/c/genc.py:102: in build_database
self.config.translation.reverse_debugger)
../rpython/translator/c/database.py:64: in __init__
self.gctransformer = self.gcpolicy.gettransformer(translator, gchooks)
../rpython/translator/c/gc.py:452: in gettransformer
return shadowstack.ShadowStackFrameworkGCTransformer(translator, gchooks)
../rpython/memory/gctransform/framework.py:132: in __init__
GCClass, GC_PARAMS = choose_gc_from_config(translator.config)
../rpython/memory/gc/base.py:593: in choose_gc_from_config
globals(), locals(), [classname])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import sys
from rpython.memory.gc.semispace import SemiSpaceGC
from rpython.memory.gc.semispace import GCFLAG_EXTERNAL, GCFLAG_FORWARDED
from rpython.memory.gc.semispace import GC_HASH_TAKEN_ADDR
> 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/generation.py:5: SyntaxError
----------------------------- Captured stderr call -----------------------------
[flowgraph] (rpython.translator.c.test.test_genc:66)entry_point
[translation:info] Annotating&simplifying...
[translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy
[flowgraph] (pypy.module.thread.test.test_gil:71)f
[flowgraph] (pypy.module.thread.gil:25)GILThreadLocals.setup_threads
[flowgraph] (rpython.rlib.rgil:153)allocate
[flowgraph] (rpython.rlib.rthread:130)start_new_thread
[flowgraph] (rpython.rlib.rthread:99)ll_start_new_thread
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)RPyThreadStart
[flowgraph] (?:6)wrapper
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_RPyThreadStart
[flowgraph] (rpython.rlib.rgil:183)acquire_maybe_in_new_thread
[flowgraph] (rpython.rlib.rgil:160)release
[flowgraph] (rpython.rlib.rthread:124)get_or_make_ident
[flowgraph] (rpython.rlib.rthread:356)get_or_make_raw
[flowgraph] (rpython.rlib.rgil:171)acquire
[flowgraph] (rpython.rlib.rthread:282)gc_thread_run
[flowgraph] (pypy.module.thread.test.test_gil:64)bootstrap
[flowgraph] (pypy.module.thread.test.test_gil:48)runme
[flowgraph] (rpython.rlib.rthread:114)get_ident
[flowgraph] (rpython.rlib.rposix:500)write
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1427)scoped_nonmovingbuffer.__init__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1431)scoped_nonmovingbuffer.__enter__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:873)get_nonmovingbuffer_ll
[flowgraph] (rpython.rlib.objectmodel:315)we_are_translated_to_c
[flowgraph] (rpython.rlib.rthread:297)gc_thread_die
[flowgraph] (rpython.rtyper.lltypesystem.rstr:116)copy_string_to_raw
[flowgraph] (rpython.rtyper.lltypesystem.rstr:63)_get_raw_buf
[flowgraph] (rpython.rtyper.lltypesystem.rstr:57)_str_ofs
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)write
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1433)scoped_nonmovingbuffer.__exit__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:937)free_nonmovingbuffer_ll
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_write
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rthread:364)setraw
[flowgraph] (rpython.rlib.rthread:364)setraw
[flowgraph] (rpython.rlib.rgil:201)yield_thread
[flowgraph] (rpython.rlib.rtime:282)sleep
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2296)scoped_alloc
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2280)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__init__
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2286)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__enter__
[flowgraph] (rpython.flowspace.specialcase:76)rpython_print_item
[flowgraph] (rpython.translator.c.test.test_genc:39)llrepr_out
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2289)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__exit__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1362)setintfield
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1362)setintfield
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)select
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_select
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rposix:113)get_saved_errno
[flowgraph] (rpython.flowspace.specialcase:95)rpython_print_newline
[flowgraph] (rpython.flowspace.specialcase:85)rpython_print_end
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (rpython.rlib.rarithmetic:139)widen
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__make_wrapper_for_0
[flowgraph] (?:1)memo_offsetof_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__sizeof_none_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__make_scoped_allocator_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__should_widen_type_0
[translation:info] usession directory: /build_dir/tmp/pytest/usession-win-rpython-305
[translation:info] already done: Annotating&simplifying
[translation:info] RTyping...
[flowgraph] (rpython.rtyper.rclass:1170)ll_runtime_type_info
[flowgraph] (rpython.rtyper.lltypesystem.rlist:470)ll_listiter
[flowgraph] (rpython.rtyper.rrange:172)ll_rangenext_up
[flowgraph] (rpython.rtyper.lltypesystem.rstr:350)ll_strlen
[flowgraph] (rpython.rtyper.rlist:588)ll_append
[flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length
[flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda>
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array
[flowgraph] (?:2)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:362)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:342)copy_item
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:2)_ll_list_resize_hint_really_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items
[flowgraph] (?:1)memo__ll_prebuilt_empty_array_0
[flowgraph] (?:1)memo__contains_gcptr_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__sizeof_none_0
[flowgraph] (rpython.rtyper.rlist:572)ll_len
[flowgraph] (rpython.rtyper.lltypesystem.rstr:1306)ll_strnext
[flowgraph] (rpython.rtyper.lltypesystem.rlist:476)ll_listnext
[flowgraph] (rpython.rtyper.lltypesystem.rlist:372)ll_getitem_fast
[flowgraph] (rpython.rtyper.rstr:425)ll_str
[flowgraph] (?:1)memo_ll_constant_0
[rtyper] specializing: 100 / 418 blocks (23%)
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:13)ll_int2dec
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned
[flowgraph] (?:2)mallocstr
[flowgraph] (rpython.rtyper.lltypesystem.rstr:36)mallocstr
[flowgraph] (rpython.rtyper.rfloat:60)ll_str
[flowgraph] (?:2)formatd
[flowgraph] (rpython.rlib.rfloat:105)formatd
[flowgraph] (rpython.rlib.rdtoa:290)dtoa_formatd
[flowgraph] (rpython.rlib.rdtoa:248)dtoa
[flowgraph] (rpython.rlib.objectmodel:397)revdb_flag_io_disabled
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_dtoa
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_freedtoa
[flowgraph] (rpython.rlib.rdtoa:97)format_number
[flowgraph] (rpython.rlib.rdtoa:82)format_nonfinite
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:11)ll_join_strs_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs
[flowgraph] (rpython.rtyper.lltypesystem.rstr:785)<lambda>
[flowgraph] (rpython.rlib.jit:294)loop_unrolling_heuristic
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:1037)cast_any_ptr
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rstr:78)copy_string_contents
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (?:2)ll_join_strs_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs
[flowgraph] (rpython.rtyper.rlist:588)ll_append
[flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length
[flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda>
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array
[flowgraph] (?:2)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:362)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:342)copy_item
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:2)_ll_list_resize_hint_really_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items
[flowgraph] (?:1)memo__ll_prebuilt_empty_array_0
[flowgraph] (?:1)memo__contains_gcptr_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (rpython.rtyper.lltypesystem.rlist:357)ll_newemptylist
[flowgraph] (rpython.rtyper.lltypesystem.rstr:1293)ll_striter
[flowgraph] (rpython.rtyper.rint:149)ll_str
[flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:218)ll_math_fmod
[flowgraph] (?:11)ll_join_chars_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rstr:821)<lambda>
[flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (?:2)ll_join_chars_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars
[flowgraph] (?:11)ll_listdelslice_startonly_look_inside_iff
[flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly
[flowgraph] (rpython.rtyper.rlist:539)ll_null_item
[flowgraph] (rpython.rtyper.rlist:912)<lambda>
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (rpython.rtyper.lltypesystem.rlist:295)_ll_list_resize_le
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (?:2)ll_listdelslice_startonly_trampoline
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly
[flowgraph] (rpython.rtyper.lltypesystem.rlist:384)ll_fixed_newlist
[flowgraph] (rpython.rtyper.rlist:726)ll_setitem_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:407)ll_fixed_setitem_fast
[flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg
[flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rrange:70)ll_newrange
[flowgraph] (rpython.rtyper.lltypesystem.rrange:91)ll_rangeiter
[flowgraph] (rpython.rtyper.rclass:870)ll_str
[flowgraph] (rpython.rtyper.lltypesystem.rstr:425)ll_strconcat
[flowgraph] (rpython.rtyper.lltypesystem.rstr:416)ll_length
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:47)ll_int2hex
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned
[flowgraph] (?:1)memo_conststr_0
[flowgraph] (?:1)memo_conststr_0
[flowgraph] (?:1)memo_conststr_0
[flowgraph] (?:1)memo_conststr_0
[rtyper] specializing: 300 / 873 blocks (34%)
[flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg
[flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rstr:354)ll_stritem_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rstr:362)ll_chr2str
[flowgraph] (rpython.rtyper.rint:434)ll_uint_py_div
[flowgraph] (?:11)ll_build_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)ll_build
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)<lambda>
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:374)ll_fold_pieces
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:346)ll_getlength
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:365)ll_shrink_final
[flowgraph] (?:2)ll_shrink_array
[flowgraph] (rpython.rlib.rgc:468)ll_shrink_array
[flowgraph] (?:2)ll_build_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)ll_build
[rtyper] specializing: 400 / 929 blocks (43%)
[rtyper] specializing: 500 / 929 blocks (53%)
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:445)ll_new
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:178)ll_append_char
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (?:2)ll_grow_by
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:94)ll_grow_by
[flowgraph] (rpython.rtyper.rstr:890)ll_char_isdigit
[rtyper] specializing: 600 / 951 blocks (63%)
[flowgraph] (rpython.rtyper.rint:525)ll_uint_py_mod
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:275)ll_append_multiple_char
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:299)ll_jit_try_append_multiple_char
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:282)_ll_append_multiple_char
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:328)ll_append_charpsize
[flowgraph] (rpython.rtyper.lltypesystem.rstr:145)copy_raw_to_string
[rtyper] specializing: 700 / 994 blocks (70%)
[flowgraph] (rpython.rtyper.lltypesystem.rstr:856)ll_stringslice_startonly
[flowgraph] (rpython.rtyper.lltypesystem.rstr:840)_ll_stringslice
[flowgraph] (?:1)memo_emptystrfun_0
[flowgraph] (rpython.rtyper.lltypesystem.rstr:1046)ll_contains
[flowgraph] (rpython.rtyper.lltypesystem.rstr:860)ll_stringslice_startstop
[rtyper] specializing: 800 / 1018 blocks (78%)
[flowgraph] (rpython.rtyper.rstr:930)ll_lower_char
[rtyper] specializing: 900 / 1023 blocks (87%)
[flowgraph] (rpython.rtyper.rbuiltin:240)ll_min
[rtyper] specializing: 1000 / 1025 blocks (97%)
[rtyper] -=- specialized 1025 blocks -=-
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)fmod
[flowgraph] (rpython.rtyper.lltypesystem.rffi:2)ccall_fmod
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rfloat:567)_likely_raise
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)fabs
[flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:91)ll_math_isnan
[flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:106)ll_math_isfinite
[flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:98)ll_math_isinf
[rtyper] -=- specialized 46 more blocks -=-
[rtyper] -=- specialized 9 more blocks -=-
[flowgraph] (rpython.rtyper.rclass:1133)ll_issubclass
[flowgraph] (rpython.rtyper.rclass:1130)ll_type
[rtyper] -=- specialized 4 more blocks -=-
[translation:info] usession directory: /build_dir/tmp/pytest/usession-win-rpython-305
[translation:info] already done: Annotating&simplifying
[translation:info] already done: RTyping
[translation:info] lltype back-end optimisations...
[backendopt:removecasts] removed 6 cast_pointers in f
[backendopt:removecasts] removed 1 cast_pointers in ll_start_new_thread__bootstrap
[backendopt:removecasts] removed 1 cast_pointers in bootstrap
[backendopt:removecasts] removed 5 cast_pointers in runme
[backendopt:removecasts] removed 1 cast_pointers in _get_raw_buf__rpy_string
[backendopt:removecasts] removed 3 cast_pointers in sleep
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__write
[backendopt:removecasts] removed 1 cast_pointers in ll_rangenext_up__rangePtr_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_strnext__stringiterPtr
[backendopt:removecasts] removed 1 cast_pointers in ll_listnext__listiterPtr
[backendopt:removecasts] removed 2 cast_pointers in dtoa_formatd__Float_Char_Signed_Signed
[backendopt:removecasts] removed 3 cast_pointers in dtoa__Float_Char_Signed_Signed_Signed_SomeList_Bool
[backendopt:removecasts] removed 4 cast_pointers in format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool
[backendopt:removecasts] removed 1 cast_pointers in format_nonfinite__arrayPtr_Signed_Signed_SomeList
[backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v15___simple_call__function_ll
[backendopt:removecasts] removed 1 cast_pointers in copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v21___simple_call__function_ll
[backendopt:removecasts] removed 1 cast_pointers in ll_grow_by__stringbuilderPtr_Signed
[backendopt:removecasts] removed 1 cast_pointers in copy_raw_to_string__arrayPtr_rpy_stringPtr_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_stringslice__rpy_stringPtr_Signed_Signed
[backendopt:removecasts] removed 3 cast_pointers in _likely_raise
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] 0.00 copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed
[backendopt:inlining] 0.00 isconstant__v58___simple_call__function_is
[backendopt:inlining] 0.00 ll_unsigned__Unsigned
[backendopt:inlining] 0.00 gc_thread_run
[backendopt:inlining] 0.00 memo_emptystrfun_0
[backendopt:inlining] 0.00 isvirtual__v36___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v47___simple_call__function_is
[backendopt:inlining] 0.00 fmod__Float_Float_star_2
[backendopt:inlining] 0.00 isconstant__v35___simple_call__function_is
[backendopt:inlining] 0.00 fabs__Float_star_1
[backendopt:inlining] 0.00 _PyPy_dg_freedtoa__arrayPtr_star_1
[backendopt:inlining] 0.00 isvirtual__v19___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v18___simple_call__function_is
[backendopt:inlining] 0.00 conditional_call__v24___simple_call__function_co_star_3
[backendopt:inlining] 0.00 ll_getlength__stringbuilderPtr
[backendopt:inlining] 0.00 isvirtual__v51___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v29___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v23___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v60___simple_call__function_is
[backendopt:inlining] 0.00 conditional_call__v6___simple_call__function_con_star_3
[backendopt:inlining] 0.00 _get_raw_buf__rpy_string
[backendopt:inlining] 0.00 conditional_call__v55___simple_call__function_co_star_2
[backendopt:inlining] 0.00 ll_append_multiple_char__stringbuilderPtr_Char_Signed
[backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_foldable_nonnegCons_arrayPtr_Signed
[backendopt:inlining] 0.00 copy_raw_to_string__arrayPtr_rpy_stringPtr_Signed_Signed
[backendopt:inlining] 0.00 isconstant__v25___simple_call__function_is
[backendopt:inlining] 0.00 conditional_call__v45___simple_call__function_co_star_3
[backendopt:inlining] 0.00 ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_Signed
[backendopt:inlining] 0.00 isconstant__v11___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v44___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v12___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v30___simple_call__function_is
[backendopt:inlining] 0.00 isvirtual__v42___simple_call__function_is
[backendopt:inlining] 0.00 memo__sizeof_none_0
[backendopt:inlining] 0.00 cast_any_ptr__Ptr_GcStruct_rpy_stringLlT_rpy_stringPtr
[backendopt:inlining] 0.00 isconstant__v41___simple_call__function_is
[backendopt:inlining] 0.00 memo_ll_constant_0
[backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0
[backendopt:inlining] 0.00 __exit____star_3
[backendopt:inlining] 0.00 copy_string_to_raw
[backendopt:inlining] 0.00 memo_conststr_0
[backendopt:inlining] 0.00 write__Signed_arrayPtr_Signed_star_3
[backendopt:inlining] 0.00 RPyThreadStart__bootstrapConst_star_1
[backendopt:inlining] 0.00 scoped_nonmovingbuffer.__enter__
[backendopt:inlining] 0.00 isconstant__v5___simple_call__function_isc
[backendopt:inlining] 0.00 get_nonmovingbuffer_ll
[backendopt:inlining] 0.00 scoped_nonmovingbuffer.__init__
[backendopt:inlining] 0.00 isconstant__v56___simple_call__function_is
[backendopt:inlining] 0.00 select__Signed_arrayPtr_arrayPtr_arrayPtr_timevalPtr_star_5
[backendopt:inlining] 0.00 ll_append_char__stringbuilderPtr_Char
[backendopt:inlining] 0.00 _PyPy_dg_dtoa__Float_Signed_Signed_arrayPtr_arrayPtr_arrayPtr_star_6
[backendopt:inlining] 0.00 isconstant__v7___simple_call__function_isc
[backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0
[backendopt:inlining] 0.00 widen__int
[backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_foldable_nonnegCons_arrayPtr_Signed
[backendopt:inlining] 0.00 gc_thread_die
[backendopt:inlining] 0.00 memo__sizeof_none_0
[backendopt:inlining] 2.00 ll_length__listPtr
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 ll_strlen__rpy_stringPtr
[backendopt:inlining] 2.00 ll_length__listPtr
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 setraw
[backendopt:inlining] 2.00 setraw
[backendopt:inlining] 2.00 ll_items__listPtr
[backendopt:inlining] 2.00 ll_items__listPtr
[backendopt:inlining] 2.00 ll_uint_py_mod__Unsigned_Unsigned
[backendopt:inlining] 2.00 ll_length__rpy_stringPtr
[backendopt:inlining] 2.00 ll_uint_py_div__Unsigned_Unsigned
[backendopt:inlining] 2.00 ll_fixed_newlist__GcArray_SignedLlT_Signed
[backendopt:inlining] 2.00 ll_math_isnan__Float
[backendopt:inlining] 2.00 ll_unsigned__Signed
[backendopt:inlining] 2.00 get_or_make_raw
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__enter__
[backendopt:inlining] 4.00 ll_str__StringR_Ptr_GcStruct_rpy_strin_rpy_stringPtr
[backendopt:inlining] 4.00 ll_math_isfinite__Float
[backendopt:inlining] 4.00 ll_min__Unsigned_Unsigned
[backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed
[backendopt:inlining] 4.00 ll_stritem_nonneg__rpy_stringPtr_Signed
[backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed
[backendopt:inlining] 4.00 ll_fixed_setitem_fast__arrayPtr_Signed_Signed
[backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed
[backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed
[backendopt:inlining] 4.00 __exit____star_3
[backendopt:inlining] 4.00 setintfield__timevalPtr_c_tv_sec_Signed
[backendopt:inlining] 4.00 setintfield__timevalPtr_c_tv_usec_Signed
[backendopt:inlining] 5.00 release
[backendopt:inlining] 2.00 get_saved_errno
[backendopt:inlining] 5.00 allocate
[backendopt:inlining] 2.00 get_ident
[backendopt:inlining] 2.00 get_or_make_ident
[backendopt:inlining] 5.50 ll_math_isinf__Float
[backendopt:inlining] 6.00 _str_ofs__rpy_string
[backendopt:inlining] 6.00 ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__init__
[backendopt:inlining] 6.75 loop_unrolling_heuristic__v17___simple_call__function_lo
[backendopt:inlining] 7.00 mallocstr__Signed
[backendopt:inlining] 7.00 acquire
[backendopt:inlining] 7.00 ll_str__IntegerR_SignedConst_Signed
[backendopt:inlining] 2.00 ll_len__listPtr
[backendopt:inlining] 7.00 ll_shrink_array__rpy_stringPtr_Signed
[backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed
[backendopt:inlining] 7.00 ll_build_look_inside_iff__stringbuilderPtr
[backendopt:inlining] 7.00 ll_listdelslice_startonly_look_inside_iff__listPtr_Signed
[backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed
[backendopt:inlining] 7.00 start_new_thread__bootstrap
[backendopt:inlining] 7.00 llrepr_out__int
[backendopt:inlining] 7.00 rpython_print_newline
[backendopt:inlining] 7.50 ll_char_isdigit__Char
[backendopt:inlining] 7.50 mallocstr__Signed
[backendopt:inlining] 8.00 ll_newrange__Ptr_GcStruct_rangeLlT_Signed_Signed
[backendopt:inlining] 8.00 ll_newemptylist__GcStruct_listLlT
[backendopt:inlining] 8.00 ll_listiter__Ptr_GcStruct_listiterLlT_listPtr
[backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool
[backendopt:inlining] 9.00 ll_join_strs_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT
[backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool
[backendopt:inlining] 9.00 ll_join_chars_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT
[backendopt:inlining] 9.00 ll_str__FloatR_FloatConst_Float
[backendopt:inlining] 9.00 formatd__Float_Char_Signed_Signed
[backendopt:inlining] 9.00 formatd__Float_Char_Signed_Signed
[backendopt:inlining] 9.50 ll_chr2str__Char
[backendopt:inlining] 10.75 GILThreadLocals.setup_threads
[backendopt:inlining] 10.75 ll_lower_char__Char
[backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 11.00 ll_stringslice_startonly__rpy_stringPtr_Signed
[backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_Char
[backendopt:inlining] 6.00 ll_getitem_fast__listPtr_Signed
[backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_GCREFPtr
[backendopt:inlining] 12.00 ll_rangeiter__Ptr_GcStruct_rangeLlT_rangePtr
[backendopt:inlining] 12.00 ll_striter__rpy_stringPtr
[backendopt:inlining] 9.00 acquire_maybe_in_new_thread
[backendopt:inlining] 12.50 ll_rangenext_up__rangePtr_Signed
[backendopt:inlining] 12.00 scoped_alloc__timeval_False
[backendopt:inlining] 13.00 free_nonmovingbuffer_ll
[backendopt:inlining] 9.00 ll_listdelslice_startonly__v39___simple_call__function_ll
[backendopt:inlining] 9.00 ll_listdelslice_startonly__v48___simple_call__function_ll
[backendopt:inlining] 12.00 bootstrap
[backendopt:inlining] 15.50 ll_strnext__stringiterPtr
[backendopt:inlining] 17.00 ll_contains__rpy_stringPtr_Char
[backendopt:inlining] 18.12 ll_stringslice_startstop__rpy_stringPtr_Signed_Signed
[backendopt:inlining] 19.00 ll_shrink_final__stringbuilderPtr
[backendopt:inlining] 21.00 ccall_fmod
[backendopt:inlining] 22.00 ll_shrink_array__rpy_stringPtr_Signed
[backendopt:inlining] 19.00 ll_listnext__listiterPtr
[backendopt:inlining] 17.00 ll_append__listPtr_Char
[backendopt:inlining] 17.00 ll_append__listPtr_GCREFPtr
[backendopt:inlining] 19.25 _errno_after__v62___simple_call__function__e
[backendopt:inlining] 19.25 _errno_after__v1___simple_call__function__er
[backendopt:inlining] 19.25 _errno_after__v3___simple_call__function__er
[backendopt:inlining] 26.16 ll_join_chars__v34___simple_call__function_ll
[backendopt:inlining] 26.16 ll_join_chars__v38___simple_call__function_ll
[backendopt:inlining] 27.50 ll_new__Signed
[backendopt:inlining] 27.50 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 30.25 handle_posix_error__write
[backendopt:inlining] 31.87 _errno_before__v61___simple_call__function__e
[backendopt:inlining] 31.87 _errno_before__v0___simple_call__function__er
[backendopt:inlining] 31.87 _errno_before__v2___simple_call__function__er
[backendopt:inlining] inlined 337 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] 2 simple mallocs removed in 'f'
[backendopt:malloc] 2 simple mallocs removed in 'll_start_new_thread__bootstrap'
[backendopt:malloc] 2 simple mallocs removed in 'RPyThreadStart__bootstrapConst_star_1'
[backendopt:malloc] 1 simple mallocs removed in 'wrapper'
[backendopt:malloc] 2 simple mallocs removed in 'runme'
[backendopt:malloc] 3 simple mallocs removed in 'write'
[backendopt:malloc] 2 simple mallocs removed in 'scoped_nonmovingbuffer.__init__'
[backendopt:malloc] 7 simple mallocs removed in 'write__Signed_arrayPtr_Signed_star_3'
[backendopt:malloc] 1 simple mallocs removed in 'sleep'
[backendopt:malloc] 1 simple mallocs removed in 'rpython_print_item'
[backendopt:malloc] 3 simple mallocs removed in 'select__Signed_arrayPtr_arrayPtr_arrayPtr_timevalPtr_star_5'
[backendopt:malloc] 1 simple mallocs removed in 'rpython_print_end'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v6___simple_call__function_con_star_3'
[backendopt:malloc] 13 simple mallocs removed in '_PyPy_dg_dtoa__Float_Signed_Signed_arrayPtr_arrayPtr_arrayPtr_star_6'
[backendopt:malloc] 3 simple mallocs removed in '_PyPy_dg_freedtoa__arrayPtr_star_1'
[backendopt:malloc] 7 simple mallocs removed in 'format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v24___simple_call__function_co_star_3'
[backendopt:malloc] 5 simple mallocs removed in 'll_math_fmod__Float_Float'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_le__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v45___simple_call__function_co_star_3'
[backendopt:malloc] 1 simple mallocs removed in 'll_append_char__stringbuilderPtr_Char'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v55___simple_call__function_co_star_2'
[backendopt:malloc] 4 simple mallocs removed in '_ll_append_multiple_char__stringbuilderPtr_Char_Signed'
[backendopt:malloc] 5 simple mallocs removed in 'fmod__Float_Float_star_2'
[backendopt:malloc] 3 simple mallocs removed in '_likely_raise'
[backendopt:malloc] 3 simple mallocs removed in 'fabs__Float_star_1'
[backendopt:malloc] removed 78 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[backendopt] merging blocks in dtoa_formatd__Float_Char_Signed_Signed
[backendopt] merging blocks in format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool
[translation:info] usession directory: /build_dir/tmp/pytest/usession-win-rpython-305
[translation:info] already done: Annotating&simplifying
[translation:info] already done: RTyping
[translation:info] already done: lltype back-end optimisations
[translation:info] inserting stack checks...
[flowgraph] (rpython.rlib.rstack:42)stack_check
[flowgraph] (rpython.rlib.rstack:67)stack_check_slowpath
[rtyper] -=- specialized 8 more blocks -=-
[translation:info] inserted 0 stack checks.
[translation:info] Creating database for generating c source...
[flowgraph] (rpython.translator.exceptiontransform:100)rpyexc_occurred
[flowgraph] (rpython.translator.exceptiontransform:104)rpyexc_fetch_type
[flowgraph] (rpython.translator.exceptiontransform:107)rpyexc_fetch_value
[flowgraph] (rpython.translator.exceptiontransform:110)rpyexc_clear
[flowgraph] (rpython.translator.exceptiontransform:114)rpyexc_raise
[flowgraph] (rpython.translator.exceptiontransform:128)rpyexc_reraise
[flowgraph] (rpython.translator.exceptiontransform:133)rpyexc_fetch_exception
[flowgraph] (rpython.translator.exceptiontransform:138)rpyexc_restore_exception
[flowgraph] (rpython.translator.exceptiontransform:539)rpyexc_get_exception_addr
[flowgraph] (rpython.translator.exceptiontransform:543)rpyexc_get_exc_value_addr
[flowgraph] (rpython.rtyper.rclass:1173)ll_inst_type
[rtyper] specializing: 1100 / 1117 blocks (98%)
[rtyper] -=- specialized 25 more blocks -=-
[flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize
[flowgraph] (rpython.memory.gctransform.transform:454)_ll_malloc_fixedsize_zero
[flowgraph] (rpython.memory.gctransform.transform:470)_ll_malloc_varsize_no_length
[flowgraph] (rpython.memory.gctransform.transform:487)ll_malloc_varsize
[flowgraph] (rpython.memory.gctransform.transform:493)_ll_malloc_varsize_no_length_zero
____________________ TestUsingFramework.test_one_thread_rev ____________________
self = <pypy.module.thread.test.test_gil.TestUsingFramework object at 0xf37951cc>
def test_one_thread_rev(self):
> self.test_one_thread(skew=-1)
module/thread/test/test_gil.py:112:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
module/thread/test/test_gil.py:107: in test_one_thread
fn = self.getcompiled(f, [])
../rpython/translator/c/test/test_boehm.py:40: in getcompiled
thread=self.use_threads, **extra_options)
../rpython/translator/c/test/test_genc.py:124: in compile
t.compile_c()
../rpython/translator/interactive.py:123: in compile_c
self.driver.compile_c()
../rpython/translator/driver.py:108: in proc
return self.proceed(backend_goal)
../rpython/translator/driver.py:568: in proceed
result = self._execute(goals, task_skip = self._maybe_skip())
../rpython/translator/tool/taskengine.py:114: in _execute
res = self._do(goal, taskcallable, *args, **kwds)
../rpython/translator/driver.py:278: in _do
res = func()
../rpython/translator/driver.py:435: in task_database_c
database = cbuilder.build_database()
../rpython/translator/c/genc.py:102: in build_database
self.config.translation.reverse_debugger)
../rpython/translator/c/database.py:64: in __init__
self.gctransformer = self.gcpolicy.gettransformer(translator, gchooks)
../rpython/translator/c/gc.py:452: in gettransformer
return shadowstack.ShadowStackFrameworkGCTransformer(translator, gchooks)
../rpython/memory/gctransform/framework.py:132: in __init__
GCClass, GC_PARAMS = choose_gc_from_config(translator.config)
../rpython/memory/gc/base.py:593: in choose_gc_from_config
globals(), locals(), [classname])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import sys
from rpython.memory.gc.semispace import SemiSpaceGC
from rpython.memory.gc.semispace import GCFLAG_EXTERNAL, GCFLAG_FORWARDED
from rpython.memory.gc.semispace import GC_HASH_TAKEN_ADDR
> 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/generation.py:5: SyntaxError
----------------------------- Captured stderr call -----------------------------
[flowgraph] (rpython.translator.c.test.test_genc:66)entry_point
[translation:info] Annotating&simplifying...
[translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy
[flowgraph] (pypy.module.thread.test.test_gil:71)f
[flowgraph] (pypy.module.thread.gil:25)GILThreadLocals.setup_threads
[flowgraph] (rpython.rlib.rgil:153)allocate
[flowgraph] (rpython.rlib.rthread:130)start_new_thread
[flowgraph] (rpython.rlib.rthread:99)ll_start_new_thread
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)RPyThreadStart
[flowgraph] (?:6)wrapper
[flowgraph] (rpython.rlib.rgil:183)acquire_maybe_in_new_thread
[flowgraph] (rpython.rlib.rthread:124)get_or_make_ident
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_RPyThreadStart
[flowgraph] (rpython.rlib.rthread:356)get_or_make_raw
[flowgraph] (rpython.rlib.rgil:160)release
[flowgraph] (rpython.rlib.rgil:171)acquire
[flowgraph] (rpython.rlib.rthread:282)gc_thread_run
[flowgraph] (pypy.module.thread.test.test_gil:64)bootstrap
[flowgraph] (rpython.rlib.rposix:500)write
[flowgraph] (pypy.module.thread.test.test_gil:48)runme
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1427)scoped_nonmovingbuffer.__init__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1431)scoped_nonmovingbuffer.__enter__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:873)get_nonmovingbuffer_ll
[flowgraph] (rpython.rlib.rthread:114)get_ident
[flowgraph] (rpython.rlib.objectmodel:315)we_are_translated_to_c
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rthread:297)gc_thread_die
[flowgraph] (rpython.rtyper.lltypesystem.rstr:116)copy_string_to_raw
[flowgraph] (rpython.rlib.rgil:201)yield_thread
[flowgraph] (rpython.rtyper.lltypesystem.rstr:63)_get_raw_buf
[flowgraph] (rpython.rtyper.lltypesystem.rstr:57)_str_ofs
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)write
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1433)scoped_nonmovingbuffer.__exit__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:937)free_nonmovingbuffer_ll
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_write
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rthread:364)setraw
[flowgraph] (rpython.rlib.rthread:364)setraw
[flowgraph] (rpython.rlib.rtime:282)sleep
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2296)scoped_alloc
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2280)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__init__
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2286)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__enter__
[flowgraph] (rpython.flowspace.specialcase:76)rpython_print_item
[flowgraph] (rpython.translator.c.test.test_genc:39)llrepr_out
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2289)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__exit__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1362)setintfield
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1362)setintfield
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)select
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_select
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rposix:113)get_saved_errno
[flowgraph] (rpython.flowspace.specialcase:95)rpython_print_newline
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (rpython.flowspace.specialcase:85)rpython_print_end
[flowgraph] (rpython.rlib.rarithmetic:139)widen
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__make_wrapper_for_0
[flowgraph] (?:1)memo_offsetof_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__sizeof_none_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__make_scoped_allocator_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__should_widen_type_0
[translation:info] usession directory: /build_dir/tmp/pytest/usession-win-rpython-305
[translation:info] already done: Annotating&simplifying
[translation:info] RTyping...
[flowgraph] (rpython.rtyper.rclass:1170)ll_runtime_type_info
[flowgraph] (rpython.rtyper.rlist:572)ll_len
[flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length
[flowgraph] (rpython.rtyper.lltypesystem.rstr:1293)ll_striter
[flowgraph] (rpython.rtyper.rint:149)ll_str
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:13)ll_int2dec
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned
[flowgraph] (?:2)mallocstr
[flowgraph] (rpython.rtyper.lltypesystem.rstr:36)mallocstr
[flowgraph] (rpython.rtyper.rlist:588)ll_append
[flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length
[flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda>
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array
[flowgraph] (?:2)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:362)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:342)copy_item
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:2)_ll_list_resize_hint_really_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items
[flowgraph] (?:1)memo__ll_prebuilt_empty_array_0
[flowgraph] (?:1)memo__contains_gcptr_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (rpython.rtyper.lltypesystem.rstr:350)ll_strlen
[flowgraph] (rpython.rtyper.lltypesystem.rlist:476)ll_listnext
[flowgraph] (rpython.rtyper.lltypesystem.rlist:372)ll_getitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items
[flowgraph] (rpython.rtyper.lltypesystem.rstr:1306)ll_strnext
[flowgraph] (rpython.rtyper.rfloat:60)ll_str
[flowgraph] (?:2)formatd
[flowgraph] (rpython.rlib.rfloat:105)formatd
[flowgraph] (rpython.rlib.rdtoa:290)dtoa_formatd
[flowgraph] (rpython.rlib.rdtoa:248)dtoa
[flowgraph] (rpython.rlib.objectmodel:397)revdb_flag_io_disabled
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_dtoa
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_freedtoa
[flowgraph] (rpython.rlib.rdtoa:97)format_number
[flowgraph] (rpython.rlib.rdtoa:82)format_nonfinite
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:11)ll_join_strs_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rstr:785)<lambda>
[flowgraph] (rpython.rlib.jit:294)loop_unrolling_heuristic
[flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:1037)cast_any_ptr
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rstr:78)copy_string_contents
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (?:2)ll_join_strs_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs
[rtyper] specializing: 100 / 654 blocks (15%)
[flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:218)ll_math_fmod
[flowgraph] (rpython.rtyper.lltypesystem.rlist:470)ll_listiter
[flowgraph] (rpython.rtyper.rstr:425)ll_str
[flowgraph] (?:1)memo_ll_constant_0
[rtyper] specializing: 200 / 661 blocks (30%)
[flowgraph] (rpython.rtyper.rrange:172)ll_rangenext_up
[flowgraph] (?:11)ll_join_chars_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars
[flowgraph] (rpython.rtyper.lltypesystem.rstr:821)<lambda>
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (?:2)ll_join_chars_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars
[flowgraph] (?:11)ll_listdelslice_startonly_look_inside_iff
[flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly
[flowgraph] (rpython.rtyper.rlist:539)ll_null_item
[flowgraph] (rpython.rtyper.rlist:912)<lambda>
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (rpython.rtyper.lltypesystem.rlist:295)_ll_list_resize_le
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (?:2)ll_listdelslice_startonly_trampoline
[flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly
[flowgraph] (rpython.rtyper.lltypesystem.rlist:384)ll_fixed_newlist
[flowgraph] (rpython.rtyper.rlist:726)ll_setitem_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:407)ll_fixed_setitem_fast
[flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg
[flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rrange:70)ll_newrange
[flowgraph] (rpython.rtyper.lltypesystem.rrange:91)ll_rangeiter
[flowgraph] (rpython.rtyper.rlist:588)ll_append
[flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda>
[flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:2)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:362)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:342)copy_item
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast
[flowgraph] (?:2)_ll_list_resize_hint_really_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (?:1)memo__ll_prebuilt_empty_array_0
[flowgraph] (?:1)memo__contains_gcptr_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__sizeof_none_0
[flowgraph] (rpython.rtyper.rclass:870)ll_str
[flowgraph] (rpython.rtyper.lltypesystem.rstr:425)ll_strconcat
[flowgraph] (rpython.rtyper.lltypesystem.rstr:416)ll_length
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:47)ll_int2hex
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned
[flowgraph] (?:1)memo_conststr_0
[flowgraph] (?:1)memo_conststr_0
[flowgraph] (?:1)memo_conststr_0
[flowgraph] (?:1)memo_conststr_0
[flowgraph] (rpython.rtyper.lltypesystem.rlist:357)ll_newemptylist
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:275)ll_append_multiple_char
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:299)ll_jit_try_append_multiple_char
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:282)_ll_append_multiple_char
[flowgraph] (?:2)ll_grow_by
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:94)ll_grow_by
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:178)ll_append_char
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (rpython.rtyper.lltypesystem.rstr:354)ll_stritem_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rstr:362)ll_chr2str
[rtyper] specializing: 400 / 926 blocks (43%)
[flowgraph] (rpython.rtyper.lltypesystem.rstr:860)ll_stringslice_startstop
[flowgraph] (rpython.rtyper.lltypesystem.rstr:840)_ll_stringslice
[flowgraph] (?:1)memo_emptystrfun_0
[flowgraph] (rpython.rtyper.rstr:930)ll_lower_char
[flowgraph] (rpython.rtyper.lltypesystem.rstr:1046)ll_contains
[rtyper] specializing: 500 / 953 blocks (52%)
[flowgraph] (rpython.rtyper.rint:434)ll_uint_py_div
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:328)ll_append_charpsize
[flowgraph] (rpython.rtyper.lltypesystem.rstr:145)copy_raw_to_string
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:445)ll_new
[flowgraph] (rpython.rtyper.rstr:890)ll_char_isdigit
[rtyper] specializing: 600 / 970 blocks (61%)
[flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg
[flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast
[flowgraph] (rpython.rtyper.rint:525)ll_uint_py_mod
[flowgraph] (rpython.rtyper.lltypesystem.rstr:856)ll_stringslice_startonly
[rtyper] specializing: 700 / 981 blocks (71%)
[rtyper] specializing: 800 / 981 blocks (81%)
[flowgraph] (?:11)ll_build_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)ll_build
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)<lambda>
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:374)ll_fold_pieces
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:346)ll_getlength
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:365)ll_shrink_final
[flowgraph] (?:2)ll_shrink_array
[flowgraph] (rpython.rlib.rgc:468)ll_shrink_array
[flowgraph] (?:2)ll_build_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)ll_build
[rtyper] specializing: 900 / 1023 blocks (87%)
[flowgraph] (rpython.rtyper.rbuiltin:240)ll_min
[rtyper] specializing: 1000 / 1025 blocks (97%)
[rtyper] -=- specialized 1025 blocks -=-
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)fmod
[flowgraph] (rpython.rtyper.lltypesystem.rffi:2)ccall_fmod
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rfloat:567)_likely_raise
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)fabs
[flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:98)ll_math_isinf
[flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:106)ll_math_isfinite
[flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:91)ll_math_isnan
[rtyper] -=- specialized 46 more blocks -=-
[rtyper] -=- specialized 9 more blocks -=-
[flowgraph] (rpython.rtyper.rclass:1133)ll_issubclass
[flowgraph] (rpython.rtyper.rclass:1130)ll_type
[rtyper] -=- specialized 4 more blocks -=-
[translation:info] usession directory: /build_dir/tmp/pytest/usession-win-rpython-305
[translation:info] already done: Annotating&simplifying
[translation:info] already done: RTyping
[translation:info] lltype back-end optimisations...
[backendopt:removecasts] removed 6 cast_pointers in f
[backendopt:removecasts] removed 1 cast_pointers in ll_start_new_thread__bootstrap
[backendopt:removecasts] removed 1 cast_pointers in bootstrap
[backendopt:removecasts] removed 5 cast_pointers in runme
[backendopt:removecasts] removed 1 cast_pointers in _get_raw_buf__rpy_string
[backendopt:removecasts] removed 3 cast_pointers in sleep
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__write
[backendopt:removecasts] removed 1 cast_pointers in ll_listnext__listiterPtr
[backendopt:removecasts] removed 1 cast_pointers in ll_strnext__stringiterPtr
[backendopt:removecasts] removed 2 cast_pointers in dtoa_formatd__Float_Char_Signed_Signed
[backendopt:removecasts] removed 3 cast_pointers in dtoa__Float_Char_Signed_Signed_Signed_SomeList_Bool
[backendopt:removecasts] removed 4 cast_pointers in format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool
[backendopt:removecasts] removed 1 cast_pointers in format_nonfinite__arrayPtr_Signed_Signed_SomeList
[backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v80___simple_call__function_ll
[backendopt:removecasts] removed 1 cast_pointers in copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v84___simple_call__function_ll
[backendopt:removecasts] removed 1 cast_pointers in ll_rangenext_up__rangePtr_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_grow_by__stringbuilderPtr_Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_stringslice__rpy_stringPtr_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in copy_raw_to_string__arrayPtr_rpy_stringPtr_Signed_Signed
[backendopt:removecasts] removed 3 cast_pointers in _likely_raise
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] 0.00 memo_conststr_0
[backendopt:inlining] 0.00 isconstant__v81___simple_call__function_is
[backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_foldable_nonnegCons_arrayPtr_Signed
[backendopt:inlining] 0.00 isconstant__v109___simple_call__function_i
[backendopt:inlining] 0.00 _PyPy_dg_dtoa__Float_Signed_Signed_arrayPtr_arrayPtr_arrayPtr_star_6
[backendopt:inlining] 0.00 isconstant__v114___simple_call__function_i
[backendopt:inlining] 0.00 gc_thread_run
[backendopt:inlining] 0.00 cast_any_ptr__Ptr_GcStruct_rpy_stringLlT_rpy_stringPtr
[backendopt:inlining] 0.00 conditional_call__v104___simple_call__function_c_star_3
[backendopt:inlining] 0.00 isconstant__v112___simple_call__function_i
[backendopt:inlining] 0.00 _PyPy_dg_freedtoa__arrayPtr_star_1
[backendopt:inlining] 0.00 ll_unsigned__Unsigned
[backendopt:inlining] 0.00 isvirtual__v88___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v96___simple_call__function_is
[backendopt:inlining] 0.00 RPyThreadStart__bootstrapConst_star_1
[backendopt:inlining] 0.00 isconstant__v108___simple_call__function_i
[backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0
[backendopt:inlining] 0.00 fmod__Float_Float_star_2
[backendopt:inlining] 0.00 memo__sizeof_none_0
[backendopt:inlining] 0.00 copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed
[backendopt:inlining] 0.00 ll_getlength__stringbuilderPtr
[backendopt:inlining] 0.00 ll_append_char__stringbuilderPtr_Char
[backendopt:inlining] 0.00 copy_raw_to_string__arrayPtr_rpy_stringPtr_Signed_Signed
[backendopt:inlining] 0.00 isconstant__v116___simple_call__function_i
[backendopt:inlining] 0.00 isconstant__v103___simple_call__function_i
[backendopt:inlining] 0.00 isconstant__v97___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v93___simple_call__function_is
[backendopt:inlining] 0.00 isvirtual__v94___simple_call__function_is
[backendopt:inlining] 0.00 _get_raw_buf__rpy_string
[backendopt:inlining] 0.00 memo_emptystrfun_0
[backendopt:inlining] 0.00 isconstant__v102___simple_call__function_i
[backendopt:inlining] 0.00 ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_Signed
[backendopt:inlining] 0.00 ll_append_multiple_char__stringbuilderPtr_Char_Signed
[backendopt:inlining] 0.00 isvirtual__v121___simple_call__function_i
[backendopt:inlining] 0.00 memo__sizeof_none_0
[backendopt:inlining] 0.00 conditional_call__v118___simple_call__function_c_star_2
[backendopt:inlining] 0.00 isconstant__v87___simple_call__function_is
[backendopt:inlining] 0.00 conditional_call__v69___simple_call__function_co_star_3
[backendopt:inlining] 0.00 isconstant__v68___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v73___simple_call__function_is
[backendopt:inlining] 0.00 conditional_call__v98___simple_call__function_co_star_3
[backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_foldable_nonnegCons_arrayPtr_Signed
[backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0
[backendopt:inlining] 0.00 isconstant__v70___simple_call__function_is
[backendopt:inlining] 0.00 scoped_nonmovingbuffer.__init__
[backendopt:inlining] 0.00 __exit____star_3
[backendopt:inlining] 0.00 copy_string_to_raw
[backendopt:inlining] 0.00 widen__int
[backendopt:inlining] 0.00 select__Signed_arrayPtr_arrayPtr_arrayPtr_timevalPtr_star_5
[backendopt:inlining] 0.00 write__Signed_arrayPtr_Signed_star_3
[backendopt:inlining] 0.00 scoped_nonmovingbuffer.__enter__
[backendopt:inlining] 0.00 get_nonmovingbuffer_ll
[backendopt:inlining] 0.00 fabs__Float_star_1
[backendopt:inlining] 0.00 isvirtual__v82___simple_call__function_is
[backendopt:inlining] 0.00 memo_ll_constant_0
[backendopt:inlining] 0.00 isconstant__v75___simple_call__function_is
[backendopt:inlining] 0.00 gc_thread_die
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 ll_length__listPtr
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 setraw
[backendopt:inlining] 2.00 ll_strlen__rpy_stringPtr
[backendopt:inlining] 2.00 ll_length__listPtr
[backendopt:inlining] 2.00 setraw
[backendopt:inlining] 2.00 ll_items__listPtr
[backendopt:inlining] 2.00 ll_items__listPtr
[backendopt:inlining] 2.00 ll_uint_py_div__Unsigned_Unsigned
[backendopt:inlining] 2.00 ll_uint_py_mod__Unsigned_Unsigned
[backendopt:inlining] 2.00 ll_length__rpy_stringPtr
[backendopt:inlining] 2.00 get_or_make_raw
[backendopt:inlining] 2.00 ll_math_isnan__Float
[backendopt:inlining] 2.00 ll_fixed_newlist__GcArray_SignedLlT_Signed
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__enter__
[backendopt:inlining] 2.00 ll_unsigned__Signed
[backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed
[backendopt:inlining] 4.00 ll_stritem_nonneg__rpy_stringPtr_Signed
[backendopt:inlining] 4.00 ll_min__Unsigned_Unsigned
[backendopt:inlining] 4.00 ll_math_isfinite__Float
[backendopt:inlining] 4.00 ll_fixed_setitem_fast__arrayPtr_Signed_Signed
[backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed
[backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed
[backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed
[backendopt:inlining] 4.00 setintfield__timevalPtr_c_tv_sec_Signed
[backendopt:inlining] 4.00 __exit____star_3
[backendopt:inlining] 4.00 setintfield__timevalPtr_c_tv_usec_Signed
[backendopt:inlining] 5.00 release
[backendopt:inlining] 2.00 get_saved_errno
[backendopt:inlining] 2.00 get_ident
[backendopt:inlining] 5.00 allocate
[backendopt:inlining] 2.00 get_or_make_ident
[backendopt:inlining] 5.50 ll_math_isinf__Float
[backendopt:inlining] 6.00 _str_ofs__rpy_string
[backendopt:inlining] 6.00 ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__init__
[backendopt:inlining] 7.00 mallocstr__Signed
[backendopt:inlining] 7.00 acquire
[backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed
[backendopt:inlining] 2.00 ll_len__listPtr
[backendopt:inlining] 7.00 ll_str__IntegerR_SignedConst_Signed
[backendopt:inlining] 7.00 start_new_thread__bootstrap
[backendopt:inlining] 7.00 ll_build_look_inside_iff__stringbuilderPtr
[backendopt:inlining] 7.00 ll_shrink_array__rpy_stringPtr_Signed
[backendopt:inlining] 7.00 ll_listdelslice_startonly_look_inside_iff__listPtr_Signed
[backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed
[backendopt:inlining] 7.00 llrepr_out__int
[backendopt:inlining] 7.00 rpython_print_newline
[backendopt:inlining] 7.50 ll_char_isdigit__Char
[backendopt:inlining] 7.50 mallocstr__Signed
[backendopt:inlining] 8.00 ll_newrange__Ptr_GcStruct_rangeLlT_Signed_Signed
[backendopt:inlining] 8.00 ll_newemptylist__GcStruct_listLlT
[backendopt:inlining] 8.00 ll_listiter__Ptr_GcStruct_listiterLlT_listPtr
[backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool
[backendopt:inlining] 9.00 ll_join_strs_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT
[backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool
[backendopt:inlining] 9.00 ll_str__FloatR_FloatConst_Float
[backendopt:inlining] 9.00 formatd__Float_Char_Signed_Signed
[backendopt:inlining] 9.00 formatd__Float_Char_Signed_Signed
[backendopt:inlining] 9.00 ll_join_chars_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT
[backendopt:inlining] 4.00 ll_str__StringR_Ptr_GcStruct_rpy_strin_rpy_stringPtr
[backendopt:inlining] 9.50 ll_chr2str__Char
[backendopt:inlining] 10.75 GILThreadLocals.setup_threads
[backendopt:inlining] 10.75 ll_lower_char__Char
[backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 11.00 ll_stringslice_startonly__rpy_stringPtr_Signed
[backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_GCREFPtr
[backendopt:inlining] 6.00 ll_getitem_fast__listPtr_Signed
[backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_Char
[backendopt:inlining] 12.00 ll_rangeiter__Ptr_GcStruct_rangeLlT_rangePtr
[backendopt:inlining] 12.00 ll_striter__rpy_stringPtr
[backendopt:inlining] 9.00 acquire_maybe_in_new_thread
[backendopt:inlining] 12.25 loop_unrolling_heuristic__v79___simple_call__function_lo
[backendopt:inlining] 12.50 ll_rangenext_up__rangePtr_Signed
[backendopt:inlining] 12.00 scoped_alloc__timeval_False
[backendopt:inlining] 13.00 free_nonmovingbuffer_ll
[backendopt:inlining] 9.00 ll_listdelslice_startonly__v91___simple_call__function_ll
[backendopt:inlining] 9.00 ll_listdelslice_startonly__v100___simple_call__function_l
[backendopt:inlining] 12.00 bootstrap
[backendopt:inlining] 15.50 ll_strnext__stringiterPtr
[backendopt:inlining] 17.00 ll_contains__rpy_stringPtr_Char
[backendopt:inlining] 18.12 ll_stringslice_startstop__rpy_stringPtr_Signed_Signed
[backendopt:inlining] 19.00 ll_shrink_final__stringbuilderPtr
[backendopt:inlining] 21.00 ccall_fmod
[backendopt:inlining] 22.00 ll_shrink_array__rpy_stringPtr_Signed
[backendopt:inlining] 19.00 ll_listnext__listiterPtr
[backendopt:inlining] 17.00 ll_append__listPtr_Char
[backendopt:inlining] 17.00 ll_append__listPtr_GCREFPtr
[backendopt:inlining] 19.25 _errno_after__v64___simple_call__function__e
[backendopt:inlining] 19.25 _errno_after__v125___simple_call__function__
[backendopt:inlining] 19.25 _errno_after__v66___simple_call__function__e
[backendopt:inlining] 26.16 ll_join_chars__v85___simple_call__function_ll
[backendopt:inlining] 26.16 ll_join_chars__v90___simple_call__function_ll
[backendopt:inlining] 27.50 ll_new__Signed
[backendopt:inlining] 27.50 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 30.25 handle_posix_error__write
[backendopt:inlining] 31.87 _errno_before__v124___simple_call__function__
[backendopt:inlining] 31.87 _errno_before__v63___simple_call__function__e
[backendopt:inlining] 31.87 _errno_before__v65___simple_call__function__e
[backendopt:inlining] inlined 346 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] 2 simple mallocs removed in 'f'
[backendopt:malloc] 2 simple mallocs removed in 'll_start_new_thread__bootstrap'
[backendopt:malloc] 2 simple mallocs removed in 'RPyThreadStart__bootstrapConst_star_1'
[backendopt:malloc] 1 simple mallocs removed in 'wrapper'
[backendopt:malloc] 3 simple mallocs removed in 'write'
[backendopt:malloc] 2 simple mallocs removed in 'runme'
[backendopt:malloc] 2 simple mallocs removed in 'scoped_nonmovingbuffer.__init__'
[backendopt:malloc] 7 simple mallocs removed in 'write__Signed_arrayPtr_Signed_star_3'
[backendopt:malloc] 1 simple mallocs removed in 'sleep'
[backendopt:malloc] 1 simple mallocs removed in 'rpython_print_item'
[backendopt:malloc] 3 simple mallocs removed in 'select__Signed_arrayPtr_arrayPtr_arrayPtr_timevalPtr_star_5'
[backendopt:malloc] 1 simple mallocs removed in 'rpython_print_end'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v69___simple_call__function_co_star_3'
[backendopt:malloc] 13 simple mallocs removed in '_PyPy_dg_dtoa__Float_Signed_Signed_arrayPtr_arrayPtr_arrayPtr_star_6'
[backendopt:malloc] 3 simple mallocs removed in '_PyPy_dg_freedtoa__arrayPtr_star_1'
[backendopt:malloc] 7 simple mallocs removed in 'format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool'
[backendopt:malloc] 5 simple mallocs removed in 'll_math_fmod__Float_Float'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_le__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v98___simple_call__function_co_star_3'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v104___simple_call__function_c_star_3'
[backendopt:malloc] 4 simple mallocs removed in '_ll_append_multiple_char__stringbuilderPtr_Char_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'll_append_char__stringbuilderPtr_Char'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v118___simple_call__function_c_star_2'
[backendopt:malloc] 5 simple mallocs removed in 'fmod__Float_Float_star_2'
[backendopt:malloc] 3 simple mallocs removed in '_likely_raise'
[backendopt:malloc] 3 simple mallocs removed in 'fabs__Float_star_1'
[backendopt:malloc] removed 78 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[backendopt] merging blocks in dtoa_formatd__Float_Char_Signed_Signed
[backendopt] merging blocks in format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool
[translation:info] usession directory: /build_dir/tmp/pytest/usession-win-rpython-305
[translation:info] already done: Annotating&simplifying
[translation:info] already done: RTyping
[translation:info] already done: lltype back-end optimisations
[translation:info] inserting stack checks...
[flowgraph] (rpython.rlib.rstack:42)stack_check
[flowgraph] (rpython.rlib.rstack:67)stack_check_slowpath
[rtyper] -=- specialized 8 more blocks -=-
[translation:info] inserted 0 stack checks.
[translation:info] Creating database for generating c source...
[flowgraph] (rpython.translator.exceptiontransform:100)rpyexc_occurred
[flowgraph] (rpython.translator.exceptiontransform:104)rpyexc_fetch_type
[flowgraph] (rpython.translator.exceptiontransform:107)rpyexc_fetch_value
[flowgraph] (rpython.translator.exceptiontransform:110)rpyexc_clear
[flowgraph] (rpython.translator.exceptiontransform:114)rpyexc_raise
[flowgraph] (rpython.translator.exceptiontransform:128)rpyexc_reraise
[flowgraph] (rpython.translator.exceptiontransform:133)rpyexc_fetch_exception
[flowgraph] (rpython.translator.exceptiontransform:138)rpyexc_restore_exception
[flowgraph] (rpython.translator.exceptiontransform:539)rpyexc_get_exception_addr
[flowgraph] (rpython.translator.exceptiontransform:543)rpyexc_get_exc_value_addr
[flowgraph] (rpython.rtyper.rclass:1173)ll_inst_type
[rtyper] specializing: 1100 / 1117 blocks (98%)
[rtyper] -=- specialized 25 more blocks -=-
[flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize
[flowgraph] (rpython.memory.gctransform.transform:454)_ll_malloc_fixedsize_zero
[flowgraph] (rpython.memory.gctransform.transform:470)_ll_malloc_varsize_no_length
[flowgraph] (rpython.memory.gctransform.transform:487)ll_malloc_varsize
[flowgraph] (rpython.memory.gctransform.transform:493)_ll_malloc_varsize_no_length_zero
__________________________ AppTestLocal.test_local_1 ___________________________
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 0xf32298b4>, 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_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_1'>}
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 0xf7a1932c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69b64cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_1'>}
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 0xf69b64cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_1'>}
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_local_1'>, '__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 0xf35c652c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_local_1'>, '__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 0xf3718b6c>
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 0xf3718b6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_local_1'>, '__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_local_1'>, '__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 0xf35c69b4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_local_1'>, '__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 0xf3718bac>
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 0xf3718bac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_local_1'>, '__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_local_1'>, '__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_local_1'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_local_1'>
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_local_1'>, space = StdObjSpace
target = <function test_local_1 at 0xf33d1924>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>)
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 0xf32d1b0c>,)
w_func = <Function test_local_1>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>
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_local_1>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>,)
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_local_1>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>,)
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_local_1, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:6]', 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()
elif nargs >= 1 and fast_natural_arity == Code.PASSTHROUGHARGS1:
assert isinstance(code, gateway.BuiltinCodePassThroughArguments1)
return code.funcrun_obj(self, args_w[0],
Arguments(self.space,
list(args_w[1:])))
> return self.call_args(Arguments(self.space, list(args_w)))
interpreter/function.py:124:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_local_1>
args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter/function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object test_local_1, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1>
func = <Function test_local_1>
args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>])
def funcrun(self, func, args):
frame = self.space.createframe(self, func.w_func_globals,
func)
sig = self._signature
# speed hack
fresh_frame = jit.hint(frame, access_directly=True,
fresh_virtualizable=True)
args.parse_into_scope(None, fresh_frame.locals_cells_stack_w, func.name,
sig, func.defs_w)
fresh_frame.init_cells()
> return frame.run()
interpreter/pycode.py:223:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33
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_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33
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_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33
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_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33
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_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33
pycode = <code object test_local_1, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1>
next_instr = 144
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5075ecc>
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_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x02\x00l\x00\x00m\x02\x00}\x03\x00...x00s:\x01t\x08\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x03\x00d\x05\x00k\x02\x00sR\x01t\x08\x00\x82\x01\x00d\x00\x00S'
next_instr = 144
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5075ecc>
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_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x02\x00l\x00\x00m\x02\x00}\x03\x00...x00s:\x01t\x08\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x03\x00d\x05\x00k\x02\x00sR\x01t\x08\x00\x82\x01\x00d\x00\x00S'
next_instr = 235L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5075ecc>
@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_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33
nameindex = 9, ignored = (235L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf51bbd8c>
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 0xf51bbd8c>
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 0xf51bbd8c>
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
___________________ AppTestLocal.test_local_is_not_immortal ____________________
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 0xf3029ed4>, 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_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_is_not_immortal'>}
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 0xf7a1932c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69b64cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_is_not_immortal'>}
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 0xf69b64cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_is_not_immortal'>}
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_local_is_not_immortal'>, '__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 0xf367b07c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_immortal'>, '__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 0xf43b08cc>
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 0xf43b08cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_immortal'>, '__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_local_is_not_immortal'>, '__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 0xf677ee64>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_immortal'>, '__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 0xf4c7bb2c>
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 0xf4c7bb2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_immortal'>, '__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_local_is_not_immortal'>, '__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_local_is_not_immortal'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_local_is_not_immortal'>
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_local_is_not_immortal'>, space = StdObjSpace
target = <function test_local_is_not_immortal at 0xf37b8f7c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>)
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 0xf32d1b0c>,)
w_func = <Function test_local_is_not_immortal>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>
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_local_is_not_immortal>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>,)
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_local_is_not_immortal>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>,)
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_local_is_not_immortal, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:111]', 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()
elif nargs >= 1 and fast_natural_arity == Code.PASSTHROUGHARGS1:
assert isinstance(code, gateway.BuiltinCodePassThroughArguments1)
return code.funcrun_obj(self, args_w[0],
Arguments(self.space,
list(args_w[1:])))
> return self.call_args(Arguments(self.space, list(args_w)))
interpreter/function.py:124:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_local_is_not_immortal>
args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter/function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object test_local_is_not_immortal, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1>
func = <Function test_local_is_not_immortal>
args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf32d1b0c>])
def funcrun(self, func, args):
frame = self.space.createframe(self, func.w_func_globals,
func)
sig = self._signature
# speed hack
fresh_frame = jit.hint(frame, access_directly=True,
fresh_virtualizable=True)
args.parse_into_scope(None, fresh_frame.locals_cells_stack_w, func.name,
sig, func.defs_w)
fresh_frame.init_cells()
> return frame.run()
interpreter/pycode.py:223:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17
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_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17
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_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17
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_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17
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_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17
pycode = <code object test_local_is_not_immortal, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5075ecc>
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_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00d\x02\x00...\x00d\x0b\x00g\x02\x00k\x02\x00s\xc7\x00t\x08\x00\x82\x01\x00\x88\x00\x00\xc9\t\x00d\x0c\x00\xca\x01\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5075ecc>
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_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00d\x02\x00...\x00d\x0b\x00g\x02\x00k\x02\x00s\xc7\x00t\x08\x00\x82\x01\x00\x88\x00\x00\xc9\t\x00d\x0c\x00\xca\x01\x00\x01d\x00\x00S'
next_instr = 168L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5075ecc>
@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_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17
nameindex = 7, ignored = (168L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf51bbd8c>
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 0xf51bbd8c>
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 0xf51bbd8c>
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
_______________________ AppTestThread.test_thread_count ________________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3468bac>
def test_thread_count(self):
import thread, time
feedback = []
please_start = []
def f():
feedback.append(42)
self.waitfor(lambda: please_start)
> assert thread._count() == 0
E (application-level) AssertionError: assert 1 == 0
E + where 1 = <built-in function _count>()
E + where <built-in function _count> = <built-in function _count>
E + where <built-in function _count> = <module 'thread' (built-in)>._count
[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_thread.py:21]:8: AssertionError
=========================== short test summary info ============================
FAIL module/thread/test/test_gil.py::TestUsingFramework::()::test_one_thread
FAIL module/thread/test/test_gil.py::TestUsingFramework::()::test_one_thread_rev
FAIL module/thread/test/test_local.py::AppTestLocal::()::test_local_1
FAIL module/thread/test/test_local.py::AppTestLocal::()::test_local_is_not_immortal
FAIL module/thread/test/test_thread.py::AppTestThread::()::test_thread_count
=============== 5 failed, 42 passed, 1 skipped in 188.87 seconds ===============
++ 09:25:47 starting module/zipimport/test [123 started in total]
__ module/test_lib_pypy [120 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 200 items / 7 skipped
module/test_lib_pypy/test_collections.py .....................
module/test_lib_pypy/test_marshal_extra.py .......................................................................................................................................................
module/test_lib_pypy/test_md5_extra.py ......
module/test_lib_pypy/test_msvcrt.py s
module/test_lib_pypy/test_pickle_extra.py s
module/test_lib_pypy/test_sha_extra.py ...
module/test_lib_pypy/test_site_extra.py .
module/test_lib_pypy/test_structseq.py .........
module/test_lib_pypy/test_tputil.py ..s....
=================== 197 passed, 10 skipped in 342.30 seconds ===================
++ 09:28:16 starting module/zlib/test [124 started in total]
__ module/micronumpy/test [121 done in total, somefailed=True] ________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 705 items / 1 skipped
module/micronumpy/test/test_appbridge.py ..
module/micronumpy/test/test_arrayops.py ....................
module/micronumpy/test/test_broadcast.py .......
module/micronumpy/test/test_casting.py ........
module/micronumpy/test/test_compile.py .............................s........
module/micronumpy/test/test_complex.py .........................
module/micronumpy/test/test_deprecations.py .
module/micronumpy/test/test_dtypes.py .............................................................................s......
module/micronumpy/test/test_flagsobj.py .......
module/micronumpy/test/test_iterators.py ...
module/micronumpy/test/test_ndarray.py ......................................................................................................................................................................................................................................................................................................
module/micronumpy/test/test_nditer.py .......s......ss..s
module/micronumpy/test/test_object_arrays.py ......sF.s..s
module/micronumpy/test/test_outarg.py .....
module/micronumpy/test/test_scalar.py ...................................
module/micronumpy/test/test_selection.py ........s.sss.....
module/micronumpy/test/test_subtype.py .........................
module/micronumpy/test/test_support.py .
module/micronumpy/test/test_support_app.py ....
module/micronumpy/test/test_ufuncs.py ................................................................................................
=================================== FAILURES ===================================
__________________ AppTestObjectDtypes.test_keep_object_alive __________________
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 0xed1be02c>, 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_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keep_object_alive'>}
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 0xf79cd32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf696976c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keep_object_alive'>}
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 0xf696976c>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keep_object_alive'>}
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_keep_object_alive'>, '__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 0xed17c5f4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ject_alive'>, '__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 0xed16cccc>
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 0xed16cccc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ject_alive'>, '__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_keep_object_alive'>, '__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 0xed17c1e4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ject_alive'>, '__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 0xed16cfac>
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 0xed16cfac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ject_alive'>, '__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_keep_object_alive'>, '__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_keep_object_alive'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_keep_object_alive'>
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_keep_object_alive'>, space = StdObjSpace
target = <function test_keep_object_alive at 0xed177bc4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed20912c>)
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 0xed20912c>,)
w_func = <Function test_keep_object_alive>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed20912c>
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_keep_object_alive>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed20912c>,)
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_keep_object_alive>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed20912c>,)
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_keep_object_alive, file '[/build_dir/own-linux-x86-32/build/pypy/module/micronumpy/test/test_object_arrays.py:102]', 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_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11
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_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11
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_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11
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_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11
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_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11
pycode = <code object test_keep_object_alive, file '[/build_dir/own-linux-x86-32/build/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xee8f734c>
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_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...01\xcc\x1c\x00|\x05\x00d\x06\x00\x19\xc9\x05\x00\xca\x00\x00d\x07\x00k\x02\x00s\x7f\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xee8f734c>
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_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...01\xcc\x1c\x00|\x05\x00d\x06\x00\x19\xc9\x05\x00\xca\x00\x00d\x07\x00k\x02\x00s\x7f\x00t\x06\x00\x82\x01\x00d\x00\x00S'
next_instr = 92L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xee8f734c>
@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_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11
nameindex = 4, ignored = (92L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xee900f6c>
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 0xee900f6c>
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 0xee900f6c>
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
=========================== short test summary info ============================
FAIL module/micronumpy/test/test_object_arrays.py::AppTestObjectDtypes::()::test_keep_object_alive
============= 1 failed, 691 passed, 14 skipped in 1008.42 seconds ==============
++ 09:28:32 starting objspace/fake/test [125 started in total]
__ objspace/fake/test [122 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 21 items
objspace/fake/test/test_checkmodule.py ........
objspace/fake/test/test_objspace.py .............
========================== 21 passed in 29.69 seconds ==========================
++ 09:29:05 starting objspace/std/test [126 started in total]
__ module/zlib/test [123 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 31 items
module/zlib/test/test_zlib.py ............................s..
==================== 30 passed, 1 skipped in 74.13 seconds =====================
++ 09:29:36 starting objspace/test [127 started in total]
__ objspace/test [124 done in total, somefailed=False] ________________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 59 items
objspace/test/apptest_binop_overriding.py .
objspace/test/apptest_descriptor.py ........
objspace/test/apptest_descroperation.py ............s..........................
objspace/test/test_descroperation.py ...........
==================== 58 passed, 1 skipped in 30.22 seconds =====================
++ 09:30:08 starting sandbox/test [128 started in total]
__ sandbox/test [125 done in total, somefailed=True] __________________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
sandbox/test/test_pypy_interact.py E
==================================== ERRORS ====================================
__________________________ ERROR at setup of test_run __________________________
mod = <module 'test_pypy_interact' from '/build_dir/own-linux-x86-32/build/pypy/sandbox/test/test_pypy_interact.py'>
def setup_module(mod):
t = Translation(mini_pypy_like_entry_point, backend='c', sandbox=True,
lldebug=True)
> mod.executable = str(t.compile())
sandbox/test/test_pypy_interact.py:79:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../rpython/translator/interactive.py:117: in compile
getattr(self.driver, 'compile_' + backend)()
../rpython/translator/driver.py:108: in proc
return self.proceed(backend_goal)
../rpython/translator/driver.py:568: in proceed
result = self._execute(goals, task_skip = self._maybe_skip())
../rpython/translator/tool/taskengine.py:114: in _execute
res = self._do(goal, taskcallable, *args, **kwds)
../rpython/translator/driver.py:278: in _do
res = func()
../rpython/translator/driver.py:435: in task_database_c
database = cbuilder.build_database()
../rpython/translator/c/genc.py:102: in build_database
self.config.translation.reverse_debugger)
../rpython/translator/c/database.py:64: in __init__
self.gctransformer = self.gcpolicy.gettransformer(translator, gchooks)
../rpython/translator/c/gc.py:452: in gettransformer
return shadowstack.ShadowStackFrameworkGCTransformer(translator, gchooks)
../rpython/memory/gctransform/framework.py:132: in __init__
GCClass, GC_PARAMS = choose_gc_from_config(translator.config)
../rpython/memory/gc/base.py:593: in choose_gc_from_config
globals(), locals(), [classname])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import sys
from rpython.memory.gc.semispace import SemiSpaceGC
from rpython.memory.gc.semispace import GCFLAG_EXTERNAL, GCFLAG_FORWARDED
from rpython.memory.gc.semispace import GC_HASH_TAKEN_ADDR
> 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/generation.py:5: SyntaxError
---------------------------- Captured stderr setup -----------------------------
[flowgraph] (test_pypy_interact:20)mini_pypy_like_entry_point
[translation:info] Annotating&simplifying...
[translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy
[flowgraph] (test_pypy_interact:15)assert_
[flowgraph] (rpython.flowspace.specialcase:76)rpython_print_item
[flowgraph] (rpython.rtyper.controllerentry:80)getattr
[flowgraph] (rpython.flowspace.specialcase:95)rpython_print_newline
[flowgraph] (rpython.flowspace.specialcase:85)rpython_print_end
[flowgraph] (rpython.rlib.rposix_environ:61)get_items
[flowgraph] (rpython.rlib.rposix:500)write
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1427)scoped_nonmovingbuffer.__init__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1431)scoped_nonmovingbuffer.__enter__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:873)get_nonmovingbuffer_ll
[flowgraph] (rpython.rlib.objectmodel:315)we_are_translated_to_c
[flowgraph] (rpython.rtyper.lltypesystem.rstr:116)copy_string_to_raw
[flowgraph] (rpython.rtyper.lltypesystem.rstr:63)_get_raw_buf
[flowgraph] (rpython.rtyper.lltypesystem.rstr:57)_str_ofs
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof
[flowgraph] (rpython.rlib.rposix_stat:637)lstat
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)write
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1433)scoped_nonmovingbuffer.__exit__
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2296)scoped_alloc
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2280)ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__init__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:937)free_nonmovingbuffer_ll
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_write
[flowgraph] (rpython.rlib.rgil:160)release
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2286)ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__enter__
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rposix:385)_as_bytes0
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2289)ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__exit__
[flowgraph] (rpython.rlib.rthread:364)setraw
[flowgraph] (rpython.rlib.rthread:364)setraw
[flowgraph] (rpython.rlib.rposix:371)_as_bytes
[flowgraph] (rpython.rlib.rgil:171)acquire
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)lstat
[flowgraph] (rpython.rlib.rthread:282)gc_thread_run
[flowgraph] (rpython.rtyper.lltypesystem.rffi:926)get_nonmovingbuffer_ll_final_null
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_lstat
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (rpython.rlib.rarithmetic:139)widen
[flowgraph] (rpython.rlib.rposix:113)get_saved_errno
[flowgraph] (rpython.rlib.rposix_stat:501)build_stat_result
[flowgraph] (stat:49)S_ISREG
[flowgraph] (stat:24)S_IFMT
[flowgraph] (rpython.rtyper.controllerentry:80)getattr
[flowgraph] (rpython.rlib.rposix_environ:66)get_get
[flowgraph] (rpython.rlib.rposix_stat:624)stat
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)stat
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_stat
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rposix:461)open
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)open
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_open
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (stat:40)S_ISDIR
[flowgraph] (rpython.rlib.rposix:490)read
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1469)scoped_alloc_buffer.__init__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1471)scoped_alloc_buffer.__enter__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:953)alloc_buffer
[flowgraph] (?:2)mallocstr
[flowgraph] (rpython.rtyper.lltypesystem.rstr:36)mallocstr
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)read
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1474)scoped_alloc_buffer.__exit__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1008)keep_buffer_alive_until_here
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_read
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1476)scoped_alloc_buffer.str
[flowgraph] (?:2)str_from_buffer
[flowgraph] (rpython.rtyper.lltypesystem.rffi:988)str_from_buffer
[flowgraph] (rpython.rtyper.lltypesystem.rstr:145)copy_raw_to_string
[flowgraph] (rpython.rlib.rposix:508)close
[flowgraph] (rpython.rlib.rposix:268)SuppressIPH.__init__
[flowgraph] (rpython.rlib.rposix:271)SuppressIPH.__enter__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)close
[flowgraph] (rpython.rlib.rposix:274)SuppressIPH.__exit__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:2)ccall_close
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (rpython.rlib.rposix:730)getcwd
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)getcwd
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_getcwd
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rtyper.lltypesystem.rffi:854)charp2str
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1030)charpsize2str
[flowgraph] (rpython.rlib.rposix:1182)strerror
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)strerror
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (rpython.rlib.rposix:1162)isatty
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)isatty
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_isatty
[flowgraph] (?:1)memo_offsetof_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__sizeof_none_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__make_scoped_allocator_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__should_widen_type_0
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_envitems
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_getenv
[flowgraph] (rpython.rlib.rmarshal:223)dump_string_or_none
[flowgraph] (rpython.rlib.rmarshal:119)w_long
[flowgraph] (rpython.rlib.rmarshal:129)dump_none
[flowgraph] (rpython.rlib.rmarshal:473)dump_tuple
[flowgraph] (rpython.rlib.rmarshal:473)dump_tuple
[flowgraph] (rpython.translator.sandbox.rsandbox:72)sandboxed_io
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2296)scoped_alloc
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2280)ScopedAlloc_Array of Char {'nolength': True} .__init__
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2286)ScopedAlloc_Array of Char {'nolength': True} .__enter__
[flowgraph] (rpython.translator.sandbox.rsandbox:40)writeall_not_sandboxed
[flowgraph] (rpython.rtyper.lltypesystem.lltype:2289)ScopedAlloc_Array of Char {'nolength': True} .__exit__
[flowgraph] (rpython.translator.sandbox.rsandbox:55)FdLoader.__init__
[flowgraph] (rpython.rlib.rmarshal:173)load_int
[flowgraph] (rpython.rlib.rmarshal:284)Loader.__init__
[flowgraph] (rpython.rlib.rmarshal:312)readchr
[flowgraph] (rpython.translator.sandbox.rsandbox:60)FdLoader.need_more_data
[flowgraph] (rpython.rlib.rmarshal:325)readlong
[flowgraph] (rpython.translator.sandbox.rsandbox:90)reraise_error
[flowgraph] (rpython.rlib.rmarshal:408)load_list_or_none
[flowgraph] (rpython.rlib.rmarshal:266)load_string_or_none
[flowgraph] (rpython.rlib.rmarshal:298)readstr
[flowgraph] (rpython.rlib.rmarshal:487)load_tuple
[flowgraph] (rpython.rlib.rmarshal:246)load_string
[flowgraph] (rpython.rlib.rmarshal:288)Loader.check_finished
[flowgraph] (?:1)memo__make_scoped_allocator_0
[translation:info] RTyping...
[flowgraph] (rpython.rtyper.rclass:1170)ll_runtime_type_info
[flowgraph] (rpython.rtyper.rstr:425)ll_str
[flowgraph] (?:1)memo_ll_constant_0
[flowgraph] (?:11)ll_join_strs_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rstr:785)<lambda>
[flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs
[flowgraph] (rpython.rlib.jit:294)loop_unrolling_heuristic
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:1037)cast_any_ptr
[flowgraph] (rpython.rtyper.lltypesystem.rstr:78)copy_string_contents
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (?:2)ll_join_strs_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs
[flowgraph] (rpython.rtyper.lltypesystem.rlist:357)ll_newemptylist
[flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array
[flowgraph] (?:1)memo__ll_prebuilt_empty_array_0
[flowgraph] (rpython.rtyper.lltypesystem.rrange:70)ll_newrange
[flowgraph] (rpython.rtyper.lltypesystem.rrange:91)ll_rangeiter
[flowgraph] (rpython.rtyper.rrange:172)ll_rangenext_up
[flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length
[flowgraph] (rpython.rtyper.rlist:717)ll_getitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:372)ll_getitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items
[flowgraph] (rpython.rtyper.rlist:572)ll_len
[rtyper] specializing: 100 / 734 blocks (13%)
[flowgraph] (rpython.rtyper.rlist:588)ll_append
[flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda>
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (?:2)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:362)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:342)copy_item
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast
[flowgraph] (?:2)_ll_list_resize_hint_really_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (?:1)memo__contains_gcptr_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:11)ll_join_chars_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rstr:821)<lambda>
[flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (?:2)ll_join_chars_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars
[flowgraph] (?:11)ll_listdelslice_startonly_look_inside_iff
[flowgraph] (rpython.rtyper.rlist:912)<lambda>
[flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.rlist:539)ll_null_item
[flowgraph] (rpython.rtyper.lltypesystem.rlist:295)_ll_list_resize_le
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:2)ll_listdelslice_startonly_trampoline
[flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_write
[flowgraph] (rpython.rtyper.lltypesystem.rstr:1293)ll_striter
[flowgraph] (rpython.rtyper.lltypesystem.rstr:1306)ll_strnext
[flowgraph] (rpython.rtyper.lltypesystem.rstr:350)ll_strlen
[flowgraph] (rpython.rtyper.lltypesystem.rstr:354)ll_stritem_nonneg
[rtyper] specializing: 200 / 882 blocks (22%)
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_stat
[flowgraph] (rpython.rtyper.lltypesystem.rstr:860)ll_stringslice_startstop
[flowgraph] (rpython.rtyper.lltypesystem.rstr:840)_ll_stringslice
[flowgraph] (?:1)memo_emptystrfun_0
[rtyper] specializing: 300 / 899 blocks (33%)
[flowgraph] (rpython.rtyper.rlist:792)ll_extend_with_str
[flowgraph] (rpython.rtyper.rlist:795)ll_extend_with_str_slice_startonly
[flowgraph] (rpython.rtyper.rlist:547)listItemType
[rtyper] specializing: 400 / 914 blocks (43%)
[flowgraph] (rpython.rtyper.lltypesystem.rlist:357)ll_newemptylist
[flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array
[flowgraph] (?:1)memo__ll_prebuilt_empty_array_0
[flowgraph] (rpython.rtyper.lltypesystem.rstr:601)ll_streq
[flowgraph] (rpython.rtyper.rlist:588)ll_append
[flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length
[flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rlib.jit:1300)conditional_call
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda>
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:2)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:362)ll_arraycopy
[flowgraph] (rpython.rlib.rgc:342)copy_item
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (?:2)_ll_list_resize_hint_really_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really
[flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items
[flowgraph] (?:1)memo__contains_gcptr_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__sizeof_none_0
[rtyper] specializing: 500 / 1013 blocks (49%)
[flowgraph] (rpython.rtyper.lltypesystem.rstr:425)ll_strconcat
[flowgraph] (rpython.rtyper.lltypesystem.rstr:416)ll_length
[flowgraph] (rpython.rtyper.rlist:572)ll_len
[flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg
[flowgraph] (rpython.rtyper.rlist:717)ll_getitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:372)ll_getitem_fast
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_lstat
[flowgraph] (rpython.rtyper.lltypesystem.rlist:384)ll_fixed_newlist
[flowgraph] (rpython.rtyper.rlist:726)ll_setitem_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:407)ll_fixed_setitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:470)ll_listiter
[flowgraph] (rpython.rtyper.lltypesystem.rlist:484)ll_listnext_foldable
[flowgraph] (rpython.rtyper.lltypesystem.rlist:395)ll_fixed_length
[flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg
[flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_stat
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_stat
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_read
[flowgraph] (rpython.rtyper.rstr:944)ll_str_is_true
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_close
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_getcwd
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_strerror
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_isatty
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_open
[rtyper] specializing: 600 / 1052 blocks (57%)
[flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_open
[rtyper] specializing: 700 / 1052 blocks (66%)
[rtyper] specializing: 800 / 1052 blocks (76%)
[rtyper] specializing: 900 / 1052 blocks (85%)
[rtyper] specializing: 1000 / 1052 blocks (95%)
[rtyper] -=- specialized 1052 blocks -=-
[flowgraph] (rpython.rlib.rmarshal:473)dump_tuple
[flowgraph] (rpython.rlib.rmarshal:473)dump_tuple
[flowgraph] (rpython.rlib.rmarshal:379)load_with_custom_recreate
[flowgraph] (rpython.rlib.rmarshal:157)dump_int
[flowgraph] (rpython.rlib.rmarshal:473)dump_tuple
[flowgraph] (rpython.rlib.rmarshal:487)load_tuple
[flowgraph] (rpython.rlib.rmarshal:473)dump_tuple
[flowgraph] (rpython.rlib.rmarshal:200)load_longlong
[flowgraph] (rpython.rlib.rmarshal:166)load_int_nonneg
[flowgraph] (rpython.rlib.rmarshal:215)load_float
[flowgraph] (rpython.rlib.rfloat:87)rstring_to_float
[flowgraph] (rpython.rlib.rdtoa:54)strtod
[flowgraph] (rpython.rlib.objectmodel:397)revdb_flag_io_disabled
[flowgraph] (rpython.rlib.rmarshal:133)load_none
[flowgraph] (rpython.rlib.rmarshal:147)load_bool
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_strtod
[flowgraph] (rpython.rlib.rposix_stat:187)stat_result_recreate
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[rtyper] specializing: 1100 / 1179 blocks (93%)
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:13)ll_int2dec
[flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned
[flowgraph] (rpython.rtyper.rint:434)ll_uint_py_div
[flowgraph] (rpython.rtyper.rint:525)ll_uint_py_mod
[rtyper] -=- specialized 147 more blocks -=-
[flowgraph] (rpython.rtyper.rclass:1133)ll_issubclass
[flowgraph] (rpython.rtyper.rclass:1130)ll_type
[rtyper] specializing: 1200 / 1203 blocks (99%)
[rtyper] -=- specialized 4 more blocks -=-
[translation:info] lltype back-end optimisations...
[backendopt:removecasts] removed 1 cast_pointers in assert_
[backendopt:removecasts] removed 1 cast_pointers in _get_raw_buf__rpy_string
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__lstat
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__open
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__stat
[backendopt:removecasts] removed 3 cast_pointers in read
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__read
[backendopt:removecasts] removed 1 cast_pointers in str_from_buffer
[backendopt:removecasts] removed 1 cast_pointers in copy_raw_to_string
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__close
[backendopt:removecasts] removed 6 cast_pointers in getcwd
[backendopt:removecasts] removed 1 cast_pointers in charpsize2str
[backendopt:removecasts] removed 1 cast_pointers in strerror
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__write
[backendopt:removecasts] removed 2 cast_pointers in isatty
[backendopt:removecasts] removed 2 cast_pointers in writeall_not_sandboxed
[backendopt:removecasts] removed 1 cast_pointers in load_int
[backendopt:removecasts] removed 4 cast_pointers in FdLoader.need_more_data
[backendopt:removecasts] removed 12 cast_pointers in reraise_error
[backendopt:removecasts] removed 1 cast_pointers in load_list_or_none
[backendopt:removecasts] removed 1 cast_pointers in load_string_or_none
[backendopt:removecasts] removed 2 cast_pointers in readstr
[backendopt:removecasts] removed 2 cast_pointers in load_tuple
[backendopt:removecasts] removed 1 cast_pointers in load_string
[backendopt:removecasts] removed 1 cast_pointers in Loader.check_finished
[backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v15___simple_call__function_ll
[backendopt:removecasts] removed 1 cast_pointers in copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v20___simple_call__function_ll
[backendopt:removecasts] removed 1 cast_pointers in ll_rangenext_up__rangePtr_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_getitem_nonneg__dum_checkidxConst_ll_getitem_fastConst_listPtr_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_strnext__stringiterPtr
[backendopt:removecasts] removed 1 cast_pointers in _ll_stringslice__rpy_stringPtr_Signed_Signed
[backendopt:removecasts] removed 2 cast_pointers in ll_extend_with_str_slice_startonly__listPtr_rpy_stringPtr_ll_strlenConst_ll_stritem_nonnegConst_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_listnext_foldable__listiterPtr
[backendopt:removecasts] removed 2 cast_pointers in load_tuple
[backendopt:removecasts] removed 1 cast_pointers in load_longlong
[backendopt:removecasts] removed 1 cast_pointers in load_int_nonneg
[backendopt:removecasts] removed 1 cast_pointers in load_float
[backendopt:removecasts] removed 2 cast_pointers in strtod
[backendopt:removecasts] removed 1 cast_pointers in load_none
[backendopt:removecasts] removed 1 cast_pointers in load_bool
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] 0.00 memo_emptystrfun_0
[backendopt:inlining] 0.00 _get_raw_buf__rpy_string
[backendopt:inlining] 0.00 _PyPy_dg_strtod__arrayPtr_arrayPtr_star_2
[backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0
[backendopt:inlining] 0.00 isconstant__v43___simple_call__function_is
[backendopt:inlining] 0.00 ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_GCREFPtr
[backendopt:inlining] 0.00 isconstant__v29___simple_call__function_is
[backendopt:inlining] 0.00 copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed
[backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0
[backendopt:inlining] 0.00 read__Signed_arrayPtr_Signed_star_3
[backendopt:inlining] 0.00 cast_any_ptr__Ptr_GcStruct_rpy_stringLlT_rpy_stringPtr
[backendopt:inlining] 0.00 get_nonmovingbuffer_ll
[backendopt:inlining] 0.00 isconstant__v45___simple_call__function_is
[backendopt:inlining] 0.00 getcwd__arrayPtr_Signed_star_2
[backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_fastConst_listPtr_Signed
[backendopt:inlining] 0.00 isconstant__v17___simple_call__function_is
[backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null
[backendopt:inlining] 0.00 conditional_call__v50___simple_call__function_co_star_3
[backendopt:inlining] 0.00 isconstant__v51___simple_call__function_is
[backendopt:inlining] 0.00 close__Signed_star_1
[backendopt:inlining] 0.00 conditional_call__v44___simple_call__function_co_star_3
[backendopt:inlining] 0.00 isconstant__v34___simple_call__function_is
[backendopt:inlining] 0.00 alloc_buffer
[backendopt:inlining] 0.00 ll_getitem_nonneg__dum_checkidxConst_ll_getitem_fastConst_listPtr_Signed
[backendopt:inlining] 0.00 memo__sizeof_none_0
[backendopt:inlining] 0.00 ll_getitem_fast__listPtr_Signed
[backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2
[backendopt:inlining] 0.00 get_items
[backendopt:inlining] 0.00 isconstant__v24___simple_call__function_is
[backendopt:inlining] 0.00 scoped_nonmovingbuffer.__init__
[backendopt:inlining] 0.00 isconstant__v55___simple_call__function_is
[backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2
[backendopt:inlining] 0.00 copy_string_to_raw
[backendopt:inlining] 0.00 isvirtual__v41___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v27___simple_call__function_is
[backendopt:inlining] 0.00 isvirtual__v18___simple_call__function_is
[backendopt:inlining] 0.00 strerror__Signed_star_1
[backendopt:inlining] 0.00 isconstant__v49___simple_call__function_is
[backendopt:inlining] 0.00 get_get
[backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2
[backendopt:inlining] 0.00 conditional_call__v23___simple_call__function_co_star_3
[backendopt:inlining] 0.00 scoped_nonmovingbuffer.__enter__
[backendopt:inlining] 0.00 write__Signed_arrayPtr_Signed_star_3
[backendopt:inlining] 0.00 __exit____star_3
[backendopt:inlining] 0.00 memo_ll_constant_0
[backendopt:inlining] 0.00 _as_bytes__str
[backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null
[backendopt:inlining] 0.00 memo__sizeof_none_0
[backendopt:inlining] 0.00 isconstant__v40___simple_call__function_is
[backendopt:inlining] 0.00 isatty__Signed_star_1
[backendopt:inlining] 0.00 widen__int
[backendopt:inlining] 0.00 ll_getitem_fast__listPtr_Signed
[backendopt:inlining] 0.00 copy_raw_to_string
[backendopt:inlining] 0.00 isvirtual__v35___simple_call__function_is
[backendopt:inlining] 0.00 isconstant__v22___simple_call__function_is
[backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2
[backendopt:inlining] 0.00 isconstant__v56___simple_call__function_is
[backendopt:inlining] 0.00 open__SomeString_Signed_Signed_star_3
[backendopt:inlining] 0.00 gc_thread_run
[backendopt:inlining] 2.00 ll_strlen__rpy_stringPtr
[backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null
[backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2
[backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2
[backendopt:inlining] 2.00 ll_length__listPtr
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 setraw
[backendopt:inlining] 2.00 setraw
[backendopt:inlining] 2.00 ll_items__listPtr
[backendopt:inlining] 2.00 ll_items__listPtr
[backendopt:inlining] 2.00 ScopedAlloc_Array of Char {'nolength': True} .__enter__
[backendopt:inlining] 2.00 ll_length__listPtr
[backendopt:inlining] 2.00 ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__enter__
[backendopt:inlining] 2.00 S_IFMT
[backendopt:inlining] 2.00 ll_unsigned__Signed
[backendopt:inlining] 2.00 ll_uint_py_div__Unsigned_Unsigned
[backendopt:inlining] 2.00 ll_uint_py_mod__Unsigned_Unsigned
[backendopt:inlining] 2.00 ll_fixed_length__arrayPtr
[backendopt:inlining] 2.00 ll_fixed_newlist__GcArray_Ptr_GCREF__gcopaque_Ll_Signed
[backendopt:inlining] 2.00 scoped_alloc_buffer.__init__
[backendopt:inlining] 2.00 ll_length__rpy_stringPtr
[backendopt:inlining] 4.00 ll_str__StringR_Ptr_GcStruct_rpy_strin_rpy_stringPtr
[backendopt:inlining] 4.00 ll_stritem_nonneg__rpy_stringPtr_Signed
[backendopt:inlining] 4.00 __exit____star_3
[backendopt:inlining] 4.00 __exit____star_3
[backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed
[backendopt:inlining] 4.00 ll_fixed_setitem_fast__arrayPtr_Signed_GCREFPtr
[backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed
[backendopt:inlining] 4.00 Loader.__init__
[backendopt:inlining] 4.00 ScopedAlloc_Array of Char {'nolength': True} .__init__
[backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed
[backendopt:inlining] 5.00 release
[backendopt:inlining] 2.00 get_saved_errno
[backendopt:inlining] 6.00 _str_ofs__rpy_string
[backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null
[backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2
[backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2
[backendopt:inlining] 6.00 ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__init__
[backendopt:inlining] 7.00 mallocstr
[backendopt:inlining] 0.00 _as_bytes0__str
[backendopt:inlining] 7.00 rstring_to_float
[backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed
[backendopt:inlining] 7.00 ll_listdelslice_startonly_look_inside_iff__listPtr_Signed
[backendopt:inlining] 2.00 ll_len__listPtr
[backendopt:inlining] 7.00 dump_none
[backendopt:inlining] 2.00 ll_len__listPtr
[backendopt:inlining] 7.00 rpython_print_newline
[backendopt:inlining] 7.50 mallocstr
[backendopt:inlining] 8.00 ll_newemptylist__GcStruct_listLlT
[backendopt:inlining] 8.00 ll_newrange__Ptr_GcStruct_rangeLlT_Signed_Signed
[backendopt:inlining] 8.00 ll_newemptylist__GcStruct_listLlT
[backendopt:inlining] 8.00 ll_listiter__Ptr_GcStruct_listiterLlT_arrayPtr
[backendopt:inlining] 9.00 ll_join_strs_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT
[backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool
[backendopt:inlining] 9.00 ll_join_chars_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT
[backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool
[backendopt:inlining] 4.00 S_ISDIR
[backendopt:inlining] 4.00 S_ISREG
[backendopt:inlining] 7.00 acquire
[backendopt:inlining] 7.00 ll_str_is_true__LLHelpersConst_rpy_stringPtr
[backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_Char
[backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_GCREFPtr
[backendopt:inlining] 6.00 ll_getitem_fast__listPtr_Signed
[backendopt:inlining] 11.00 ll_extend_with_str__listPtr_rpy_stringPtr_ll_strlenConst_ll_stritem_nonnegConst
[backendopt:inlining] 6.00 ll_getitem_fast__listPtr_Signed
[backendopt:inlining] 8.00 FdLoader.__init__
[backendopt:inlining] 11.00 str_from_buffer
[backendopt:inlining] 12.00 ll_rangeiter__Ptr_GcStruct_rangeLlT_rangePtr
[backendopt:inlining] 12.00 ll_striter__rpy_stringPtr
[backendopt:inlining] 12.25 loop_unrolling_heuristic__v16___simple_call__function_lo
[backendopt:inlining] 12.50 ll_rangenext_up__rangePtr_Signed
[backendopt:inlining] 10.00 scoped_alloc__array_False
[backendopt:inlining] 12.00 scoped_alloc__stat_False
[backendopt:inlining] 13.00 free_nonmovingbuffer_ll
[backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2
[backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2
[backendopt:inlining] 13.00 keep_buffer_alive_until_here
[backendopt:inlining] 14.00 load_with_custom_recreate
[backendopt:inlining] 14.00 dump_int
[backendopt:inlining] 14.00 dump_tuple
[backendopt:inlining] 9.00 ll_listdelslice_startonly__v39___simple_call__function_ll
[backendopt:inlining] 9.00 ll_listdelslice_startonly__v47___simple_call__function_ll
[backendopt:inlining] 14.00 load_int_nonneg
[backendopt:inlining] 14.00 load_none
[backendopt:inlining] 15.50 ll_strnext__stringiterPtr
[backendopt:inlining] 16.50 load_bool
[backendopt:inlining] 13.00 Loader.check_finished
[backendopt:inlining] 18.12 ll_stringslice_startstop__rpy_stringPtr_Signed_Signed
[backendopt:inlining] 19.00 scoped_alloc_buffer.str
[backendopt:inlining] 19.00 __exit____star_3
[backendopt:inlining] 19.25 load_int
[backendopt:inlining] 21.00 ccall_close
[backendopt:inlining] 0.00 close__Signed_star_1
[backendopt:inlining] 21.65 ll_streq__rpy_stringPtr_rpy_stringPtr
[backendopt:inlining] 23.00 dump_tuple
[backendopt:inlining] 22.25 assert_
[backendopt:inlining] 23.33 charp2str
[backendopt:inlining] 24.50 load_string
[backendopt:inlining] 17.50 ll_listnext_foldable__listiterPtr
[backendopt:inlining] 17.00 ll_append__listPtr_Char
[backendopt:inlining] 17.00 ll_append__listPtr_GCREFPtr
[backendopt:inlining] 19.25 _errno_after__v11___simple_call__function__e
[backendopt:inlining] 0.00 close__Signed_star_1
[backendopt:inlining] 19.25 _errno_after__v13___simple_call__function__e
[backendopt:inlining] 19.25 _errno_after__v7___simple_call__function__er
[backendopt:inlining] 19.25 _errno_after__v9___simple_call__function__er
[backendopt:inlining] 19.25 _errno_after__v1___simple_call__function__er
[backendopt:inlining] 19.25 _errno_after__v3___simple_call__function__er
[backendopt:inlining] 19.25 _errno_after__v5___simple_call__function__er
[backendopt:inlining] 26.16 ll_join_chars__v33___simple_call__function_ll
[backendopt:inlining] 26.16 ll_join_chars__v37___simple_call__function_ll
[backendopt:inlining] 27.00 load_string_or_none
[backendopt:inlining] 27.50 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed
[backendopt:inlining] 31.25 load_float
[backendopt:inlining] 32.00 load_longlong
[backendopt:inlining] 30.25 handle_posix_error__write
[backendopt:inlining] 30.25 handle_posix_error__read
[backendopt:inlining] 30.25 handle_posix_error__close
[backendopt:inlining] 30.25 handle_posix_error__stat
[backendopt:inlining] 30.25 handle_posix_error__open
[backendopt:inlining] 30.25 handle_posix_error__lstat
[backendopt:inlining] 31.87 _errno_before__v10___simple_call__function__e
[backendopt:inlining] 0.00 close__Signed_star_1
[backendopt:inlining] 31.87 _errno_before__v12___simple_call__function__e
[backendopt:inlining] 31.87 _errno_before__v4___simple_call__function__er
[backendopt:inlining] 31.87 _errno_before__v8___simple_call__function__er
[backendopt:inlining] 31.87 _errno_before__v0___simple_call__function__er
[backendopt:inlining] 31.87 _errno_before__v2___simple_call__function__er
[backendopt:inlining] 31.87 _errno_before__v6___simple_call__function__er
[backendopt:inlining] inlined 503 callsites.
[backendopt:removecasts] removed 2 cast_pointers in strtod
[backendopt:malloc] starting malloc removal
[backendopt:malloc] 1 simple mallocs removed in 'mini_pypy_like_entry_point'
[backendopt:malloc] 1 simple mallocs removed in 'rpython_print_item'
[backendopt:malloc] 1 simple mallocs removed in 'rpython_print_end'
[backendopt:malloc] 3 simple mallocs removed in 'write'
[backendopt:malloc] 2 simple mallocs removed in 'scoped_nonmovingbuffer.__init__'
[backendopt:malloc] 1 simple mallocs removed in 'lstat__str'
[backendopt:malloc] 7 simple mallocs removed in 'write__Signed_arrayPtr_Signed_star_3'
[backendopt:malloc] 8 simple mallocs removed in 'lstat__SomeString_statPtr_star_2'
[backendopt:malloc] 9 simple mallocs removed in 'build_stat_result'
[backendopt:malloc] 1 simple mallocs removed in 'stat__str'
[backendopt:malloc] 8 simple mallocs removed in 'stat__SomeString_statPtr_star_2'
[backendopt:malloc] 10 simple mallocs removed in 'open__str'
[backendopt:malloc] 10 simple mallocs removed in 'open__SomeString_Signed_Signed_star_3'
[backendopt:malloc] 2 simple mallocs removed in 'scoped_alloc_buffer.__enter__'
[backendopt:malloc] 7 simple mallocs removed in 'read__Signed_arrayPtr_Signed_star_3'
[backendopt:malloc] 1 simple mallocs removed in 'close'
[backendopt:malloc] 3 simple mallocs removed in 'close__Signed_star_1'
[backendopt:malloc] 5 simple mallocs removed in 'getcwd'
[backendopt:malloc] 5 simple mallocs removed in 'getcwd__arrayPtr_Signed_star_2'
[backendopt:malloc] 1 simple mallocs removed in 'isatty'
[backendopt:malloc] 1 simple mallocs removed in 'sandboxed_ll_os.ll_os_getenv__star_1'
[backendopt:malloc] 3 simple mallocs removed in 'sandboxed_io'
[backendopt:malloc] 3 simple mallocs removed in 'FdLoader.need_more_data'
[backendopt:malloc] 2 simple mallocs removed in 'load_list_or_none'
[backendopt:malloc] 3 simple mallocs removed in 'load_tuple'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v23___simple_call__function_co_star_3'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_le__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v44___simple_call__function_co_star_3'
[backendopt:malloc] 1 simple mallocs removed in 'sandboxed_ll_os.ll_os_stat__star_1'
[backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed'
[backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v50___simple_call__function_co_star_3'
[backendopt:malloc] 1 simple mallocs removed in 'sandboxed_ll_os.ll_os_stat__star_1'
[backendopt:malloc] 1 simple mallocs removed in 'sandboxed_ll_os.ll_os_stat__star_1'
[backendopt:malloc] 19 simple mallocs removed in 'load_tuple'
[backendopt:malloc] 1 simple mallocs removed in 'strtod'
[backendopt:malloc] 5 simple mallocs removed in '_PyPy_dg_strtod__arrayPtr_arrayPtr_star_2'
[backendopt:malloc] 7 simple mallocs removed in 'stat_result_recreate'
[backendopt:malloc] removed 139 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[backendopt] merging blocks in sandboxed_ll_os.ll_os_getenv__star_1
[backendopt] merging blocks in reraise_error
[backendopt] merging blocks in load_list_or_none
[backendopt] merging blocks in load_string_or_none
[backendopt] merging blocks in sandboxed_ll_os.ll_os_read__star_2
[backendopt] merging blocks in sandboxed_ll_os.ll_os_isatty__star_1
[backendopt] merging blocks in load_bool
[translation:info] inserting stack checks...
[flowgraph] (rpython.rlib.rstack:42)stack_check
[flowgraph] (rpython.rlib.rstack:67)stack_check_slowpath
[rtyper] -=- specialized 8 more blocks -=-
[translation:info] inserted 0 stack checks.
[translation:info] Creating database for generating c source...
[flowgraph] (rpython.translator.exceptiontransform:100)rpyexc_occurred
[flowgraph] (rpython.translator.exceptiontransform:104)rpyexc_fetch_type
[flowgraph] (rpython.translator.exceptiontransform:107)rpyexc_fetch_value
[flowgraph] (rpython.translator.exceptiontransform:110)rpyexc_clear
[flowgraph] (rpython.translator.exceptiontransform:114)rpyexc_raise
[flowgraph] (rpython.translator.exceptiontransform:128)rpyexc_reraise
[flowgraph] (rpython.translator.exceptiontransform:133)rpyexc_fetch_exception
[flowgraph] (rpython.translator.exceptiontransform:138)rpyexc_restore_exception
[flowgraph] (rpython.translator.exceptiontransform:539)rpyexc_get_exception_addr
[flowgraph] (rpython.translator.exceptiontransform:543)rpyexc_get_exc_value_addr
[flowgraph] (rpython.rtyper.rclass:1173)ll_inst_type
[rtyper] -=- specialized 25 more blocks -=-
[flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize
[flowgraph] (rpython.memory.gctransform.transform:454)_ll_malloc_fixedsize_zero
[flowgraph] (rpython.memory.gctransform.transform:470)_ll_malloc_varsize_no_length
[flowgraph] (rpython.memory.gctransform.transform:487)ll_malloc_varsize
[flowgraph] (rpython.memory.gctransform.transform:493)_ll_malloc_varsize_no_length_zero
=========================== 1 error in 17.40 seconds ===========================
++ 09:30:29 starting tool/bench/test [129 started in total]
__ module/unicodedata/test [126 done in total, somefailed=False] ______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 26 items
module/unicodedata/test/test_hyp.py ................
module/unicodedata/test/test_unicodedata.py ..........
========================= 26 passed in 349.77 seconds ==========================
++ 09:30:32 starting tool/memusage/test [130 started in total]
__ tool/bench/test [127 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items / 1 skipped
tool/bench/test/test_pypyresult.py ...
===================== 3 passed, 1 skipped in 4.35 seconds ======================
++ 09:30:34 starting tool/pytest/test [131 started in total]
__ tool/memusage/test [128 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 5 items
tool/memusage/test/test_log2gnumeric.py .....
=========================== 5 passed in 4.39 seconds ===========================
++ 09:30:37 starting tool/release/test [132 started in total]
__ tool/release/test [129 done in total, somefailed=False] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 8 items
tool/release/test/test_package.py ....s
tool/release/test/test_smartstrip.py ...
===================== 7 passed, 1 skipped in 37.55 seconds =====================
++ 09:31:21 starting tool/test [133 started in total]
__ tool/test [130 done in total, somefailed=False] ____________________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 29 items
tool/test/test_gdb_pypy.py ...........
tool/test/test_getdocstrings.py ...
tool/test/test_isolate.py .......
tool/test/test_lib_pypy.py ...
tool/test/test_license.py .
tool/test/test_package.py .
tool/test/test_tab.py ..
tool/test/test_template.py .
========================== 29 passed in 18.73 seconds ==========================
__ tool/pytest/test [131 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 24 items
tool/pytest/test/test_appsupport.py .........
tool/pytest/test/test_astrewrite.py .....
tool/pytest/test/test_conftest1.py ..
tool/pytest/test/test_pytestsupport.py ........
========================= 24 passed in 126.25 seconds ==========================
__ module/zipimport/test [132 done in total, somefailed=False] ________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 47 items
module/zipimport/test/test_undocumented.py ......
module/zipimport/test/test_zipimport.py ....................
module/zipimport/test/test_zipimport_deflated.py .....................
========================= 47 passed in 771.99 seconds ==========================
__ objspace/std/test [133 done in total, somefailed=True] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 2130 items
objspace/std/test/apptest_boolobject.py ........
objspace/std/test/apptest_bufferobject.py ...............
objspace/std/test/apptest_callmethod.py ........
objspace/std/test/apptest_complexobject.py ...............................
objspace/std/test/apptest_instmethobject.py .....
objspace/std/test/apptest_iterobject.py ......F.......
objspace/std/test/apptest_operation.py ...
objspace/std/test/apptest_stringformat.py ...............s...........................s........
objspace/std/test/apptest_userobject.py ...............FF.....
objspace/std/test/test_boolobject.py .......
objspace/std/test/test_bytearrayobject.py .......................................................
objspace/std/test/test_bytesobject.py ..............................................................................
objspace/std/test/test_callmethod.py ...
objspace/std/test/test_celldict.py .......................................
objspace/std/test/test_complexobject.py ....
objspace/std/test/test_dictmultiobject.py ...........s...................................................................................................................................................................
objspace/std/test/test_dictproxy.py ..........
objspace/std/test/test_floatobject.py ......................................
objspace/std/test/test_identitydict.py ......
objspace/std/test/test_identityset.py .......
objspace/std/test/test_index.py ..............................................
objspace/std/test/test_intobject.py .........................F..................................s........................................s...............
objspace/std/test/test_iterobject.py ....
objspace/std/test/test_jsondict.py ...........
objspace/std/test/test_kwargsdict.py ....................................
objspace/std/test/test_lengthhint.py ....................
objspace/std/test/test_listobject.py .......................................................................................................................
objspace/std/test/test_liststrategies.py ...................................................................s.......................................s..s..s.......s.......s....
objspace/std/test/test_longobject.py .........................................
objspace/std/test/test_mapdict.py ........................s.ss.................................................................FF................................................
objspace/std/test/test_memoryobject.py .......
objspace/std/test/test_methodcache.py .......................................................................
objspace/std/test/test_newformat.py ......................................................................................ss........
objspace/std/test/test_noneobject.py ...
objspace/std/test/test_obj.py .......................
objspace/std/test/test_prebuiltint.py ...........................s...............
objspace/std/test/test_proxy.py ssssssssssss
objspace/std/test/test_proxy_function.py ........
objspace/std/test/test_proxy_internals.py ........
objspace/std/test/test_proxy_iter.py .
objspace/std/test/test_proxy_object.py ..........
objspace/std/test/test_proxy_usercreated.py .
objspace/std/test/test_random_attr.py .....
objspace/std/test/test_setobject.py ....................................................................................
objspace/std/test/test_setstrategies.py ....s...ss..
objspace/std/test/test_sliceobject.py ............
objspace/std/test/test_smalllongobject.py .........................F..................................s........................................................................................................................s..............
objspace/std/test/test_specialisedtupleobject.py ..................ss.......................
objspace/std/test/test_stdobjspace.py s......
objspace/std/test/test_tupleobject.py ...................................
objspace/std/test/test_typeobject.py ..............................................................................
objspace/std/test/test_unicodeobject.py ..........................................................................................s.................
objspace/std/test/test_userobject.py .
objspace/std/test/test_versionedtype.py ...............
=================================== FAILURES ===================================
__________________________ test_reversed_frees_empty ___________________________
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 0xf422ded4>, 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': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_reversed_frees_empty'>}
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 0xf7a2f32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_reversed_frees_empty'>}
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 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_reversed_frees_empty'>}
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': <AppTestFunction 'test_reversed_frees_empty'>, '__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 0xf3e2d2ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rees_empty'>, '__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 0xf3bb2f6c>
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 0xf3bb2f6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rees_empty'>, '__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': <AppTestFunction 'test_reversed_frees_empty'>, '__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 0xf3c07a7c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rees_empty'>, '__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 0xf3bb2cec>
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 0xf3bb2cec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rees_empty'>, '__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': <AppTestFunction 'test_reversed_frees_empty'>, '__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 = <AppTestFunction 'test_reversed_frees_empty'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_reversed_frees_empty'>
def runtest(self):
target = self.w_obj
space = target.space
self.check_run(space, target)
> self.execute_appex(space, target)
tool/pytest/apptest2.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_reversed_frees_empty'>, space = StdObjSpace
w_func = <Function test_reversed_frees_empty>
def execute_appex(self, space, w_func):
space.getexecutioncontext().set_sys_exc_info(None)
sig = w_func.code._signature
if sig.varargname or sig.kwargname:
raise ValueError(
'Test functions may not use *args or **kwargs')
args_w = self.get_fixtures(space, sig.argnames)
try:
> space.call_function(w_func, *args_w)
tool/pytest/apptest2.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_reversed_frees_empty>, args_w = ()
nargs = 0, 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_reversed_frees_empty>, args_w = ()
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_reversed_frees_empty, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34>
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_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42
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_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42
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_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42
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_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42
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_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42
pycode = <code object test_reversed_frees_empty, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
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_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42
co_code = 'x\xbb\x00t\x00\x00t\x01\x00f\x02\x00D]\xad\x00}\x00\x00t\x02\x00g\x01\x00\x89\x00\x00d\x01\x00|\x00\x00f\x01\x00\x87\...}\x04\x00t\x0b\x00t\t\x00\xc9\x0c\x00|\x04\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00}\x03\x00q\r\x00Wd\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
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_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42
co_code = 'x\xbb\x00t\x00\x00t\x01\x00f\x02\x00D]\xad\x00}\x00\x00t\x02\x00g\x01\x00\x89\x00\x00d\x01\x00|\x00\x00f\x01\x00\x87\...}\x04\x00t\x0b\x00t\t\x00\xc9\x0c\x00|\x04\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00}\x03\x00q\r\x00Wd\x00\x00S'
next_instr = 93L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
@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_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42
nameindex = 8, ignored = (93L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52cc56c>
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 0xf52cc56c>
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 0xf52cc56c>
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
___________________________________ test_del ___________________________________
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 0xf3a16294>, 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': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del'>}
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 0xf7a2f32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del'>}
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 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del'>}
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': <AppTestFunction 'test_del'>, '__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 0xf3af1dec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__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 0xf3ad170c>
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 0xf3ad170c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__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': <AppTestFunction 'test_del'>, '__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 0xf3af1c0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__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 0xf3ad176c>
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 0xf3ad176c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__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': <AppTestFunction 'test_del'>, '__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 = <AppTestFunction 'test_del'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_del'>
def runtest(self):
target = self.w_obj
space = target.space
self.check_run(space, target)
> self.execute_appex(space, target)
tool/pytest/apptest2.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_del'>, space = StdObjSpace
w_func = <Function test_del>
def execute_appex(self, space, w_func):
space.getexecutioncontext().set_sys_exc_info(None)
sig = w_func.code._signature
if sig.varargname or sig.kwargname:
raise ValueError(
'Test functions may not use *args or **kwargs')
args_w = self.get_fixtures(space, sig.argnames)
try:
> space.call_function(w_func, *args_w)
tool/pytest/apptest2.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_del>, args_w = (), nargs = 0
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_del>, args_w = ()
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_del, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135>
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_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142
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_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142
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_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142
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_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142
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_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142
pycode = <code object test_del, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
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_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00g\x00\x00\x89\x00\x00d\x02\x00t\x01\x00f\x01\x00\x87\x00\x00f\x01\x00d\x03\x00\x8...05\x00t\t\x00t\x03\x00\xc9\n\x00|\x05\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x03\x00}\x02\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
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_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00g\x00\x00\x89\x00\x00d\x02\x00t\x01\x00f\x01\x00\x87\x00\x00f\x01\x00d\x03\x00\x8...05\x00t\t\x00t\x03\x00\xc9\n\x00|\x05\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x03\x00}\x02\x00d\x00\x00S'
next_instr = 59L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
@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_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142
nameindex = 2, ignored = (59L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52cc56c>
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 0xf52cc56c>
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 0xf52cc56c>
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
______________________________ test_del_exception ______________________________
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 0xf3f609cc>, 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': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del_exception'>}
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 0xf7a2f32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del_exception'>}
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 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del_exception'>}
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': <AppTestFunction 'test_del_exception'>, '__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 0xf369534c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._exception'>, '__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 0xf350f48c>
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 0xf350f48c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._exception'>, '__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': <AppTestFunction 'test_del_exception'>, '__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 0xf36952fc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._exception'>, '__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 0xf350f2ec>
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 0xf350f2ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._exception'>, '__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': <AppTestFunction 'test_del_exception'>, '__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 = <AppTestFunction 'test_del_exception'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_del_exception'>
def runtest(self):
target = self.w_obj
space = target.space
self.check_run(space, target)
> self.execute_appex(space, target)
tool/pytest/apptest2.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestFunction 'test_del_exception'>, space = StdObjSpace
w_func = <Function test_del_exception>
def execute_appex(self, space, w_func):
space.getexecutioncontext().set_sys_exc_info(None)
sig = w_func.code._signature
if sig.varargname or sig.kwargname:
raise ValueError(
'Test functions may not use *args or **kwargs')
args_w = self.get_fixtures(space, sig.argnames)
try:
> space.call_function(w_func, *args_w)
tool/pytest/apptest2.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function test_del_exception>, args_w = ()
nargs = 0, 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_del_exception>, args_w = ()
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_del_exception, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145>
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_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154
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_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154
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_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154
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_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154
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_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154
pycode = <code object test_del_exception, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
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_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00d\x01\x00d\x00\x00l\x01\x00}\x01\x00d\x01\x00d\x00\x00l\x02\x00}\x02\x00d\x02\x00...0e\x00t\r\x00t\n\x00\xc9\x0e\x00|\x0e\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x0b\x00}\x0c\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
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_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00d\x01\x00d\x00\x00l\x01\x00}\x01\x00d\x01\x00d\x00\x00l\x02\x00}\x02\x00d\x02\x00...0e\x00t\r\x00t\n\x00\xc9\x0e\x00|\x0e\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x0b\x00}\x0c\x00d\x00\x00S'
next_instr = 98L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b512c>
@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_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154
nameindex = 5, ignored = (98L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf52cc56c>
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 0xf52cc56c>
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 0xf52cc56c>
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
_________________ TestW_IntObject.test_lshift_without_fromint __________________
self = <pypy.objspace.std.test.test_intobject.TestW_IntObject instance at 0xf2e63dec>
monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0xf2e638ac>
def test_lshift_without_fromint(self, monkeypatch):
space = self.space
monkeypatch.setattr(rbigint, 'fromint', None)
x = sys.maxint // 4
y = 16
f1 = iobj.W_IntObject(x)
f2 = iobj.W_IntObject(y)
> v = f1.descr_lshift(space, f2)
objspace/std/test/test_intobject.py:361:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
objspace/std/intobject.py:620: in descr_binop
return ovf2long(space, x, self, y, w_other)
objspace/std/intobject.py:645: in _ovf2long_lshift
return space.newlong_from_rbigint(rbigint.lshift_int_int_bigint_result(x, y))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iself = 536870911, int_other = 16
@staticmethod
@jit.elidable
def lshift_int_int_bigint_result(iself, int_other):
if not SUPPORT_INT128 or SHIFT != 63 or not int_in_valid_range(iself):
> return rbigint.fromint(iself).lshift(int_other)
E TypeError: 'NoneType' object is not callable
../rpython/rlib/rbigint.py:1383: TypeError
___________ AppTestWithMapDictAndCounters.test_dont_keep_class_alive ___________
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 0xf28d380c>, 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_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_keep_class_alive'>}
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 0xf7a2f32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_keep_class_alive'>}
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 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_keep_class_alive'>}
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_dont_keep_class_alive'>, '__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 0xf29a798c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__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 0xf280110c>
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 0xf280110c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__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_dont_keep_class_alive'>, '__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 0xf27ff054>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__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 0xf280172c>
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 0xf280172c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__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_dont_keep_class_alive'>, '__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_dont_keep_class_alive'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_dont_keep_class_alive'>
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_dont_keep_class_alive'>, space = StdObjSpace
target = <function test_dont_keep_class_alive at 0xf28b1bc4>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28c93ec>)
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 0xf28c93ec>,)
w_func = <Function test_dont_keep_class_alive>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28c93ec>
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_dont_keep_class_alive>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28c93ec>,)
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_dont_keep_class_alive>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28c93ec>,)
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_dont_keep_class_alive, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', 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_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
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_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
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_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
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_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
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_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
pycode = <code object test_dont_keep_class_alive, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
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_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
co_code = 'd\x01\x00d\x00\x00l\x00\x00\x89\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00\x87\x00\x00\x87\x01\x00f\x02\x00d\x02\x00\x86\x00\x00}\x01\x00|\x01\x00\x83\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
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_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
co_code = 'd\x01\x00d\x00\x00l\x00\x00\x89\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00\x87\x00\x00\x87\x01\x00f\x02\x00d\x02\x00\x86\x00\x00}\x01\x00|\x01\x00\x83\x00\x00\x01d\x00\x00S'
next_instr = 48L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
@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)
interpreter/pyopcode.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
oparg = 0, next_instr = 48L
def CALL_FUNCTION(self, oparg, next_instr):
# XXX start of hack for performance
if (oparg >> 8) & 0xff == 0:
# Only positional arguments
nargs = oparg & 0xff
w_function = self.peekvalue(nargs)
> w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/pyopcode.py:1233:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function f>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
dropvalues = 1, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function f>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
dropvalues = 1, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
> return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function f>
code = <code object f, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15
dropvalues = 1
@jit.unroll_safe
def _flat_pycall(self, code, nargs, frame, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12
pycode = <code object f, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12
co_code = 'd\x01\x00t\x00\x00f\x01\x00d\x02\x00\x84\x00\x00\x83\x00\x00Y}\x00\x00\x88\x01\x00\xc9\x01\x00|\x00\x00\xca\x01\x00}\...\x01\xcc\x15\x00|\x01\x00\x83\x00\x00d\x00\x00k\x08\x00sk\x00t\x04\x00\x82\x01\x00d\x03\x00S\x00\x82\x01\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12
co_code = 'd\x01\x00t\x00\x00f\x01\x00d\x02\x00\x84\x00\x00\x83\x00\x00Y}\x00\x00\x88\x01\x00\xc9\x01\x00|\x00\x00\xca\x01\x00}\...\x01\xcc\x15\x00|\x01\x00\x83\x00\x00d\x00\x00k\x08\x00sk\x00t\x04\x00\x82\x01\x00d\x03\x00S\x00\x82\x01\x00d\x03\x00S'
next_instr = 59L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
@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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12
nameindex = 3, ignored = (59L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf342e5cc>
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 0xf342e5cc>
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 0xf342e5cc>
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
________ AppTestWithMapDictAndCounters.test_instance_keeps_class_alive _________
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 0xf28ca64c>, 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_instance_keeps_class_alive'>, '...lticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_instance_keeps_class_alive'>}
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 0xf7a2f32c>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_instance_keeps_class_alive'>, '...lticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_instance_keeps_class_alive'>}
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 0xf69cd4cc>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_instance_keeps_class_alive'>, '...lticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_instance_keeps_class_alive'>}
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_instance_keeps_class_alive'>, '__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 0xf2bb89dc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__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 0xf294c64c>
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 0xf294c64c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__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_instance_keeps_class_alive'>, '__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 0xf2bfaf54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__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 0xf294c6ac>
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 0xf294c6ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__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_instance_keeps_class_alive'>, '__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_instance_keeps_class_alive'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_instance_keeps_class_alive'>
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_instance_keeps_class_alive'>, space = StdObjSpace
target = <function test_instance_keeps_class_alive at 0xf275fb8c>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28c93ec>)
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 0xf28c93ec>,)
w_func = <Function test_instance_keeps_class_alive>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28c93ec>
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_instance_keeps_class_alive>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28c93ec>,)
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_instance_keeps_class_alive>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28c93ec>,)
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_instance_keeps_class_alive, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', 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_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
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_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
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_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
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_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
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_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
pycode = <code object test_instance_keeps_class_alive, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
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_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00\x89\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00\x87\x00\x00\x87\x01\x00f\x02\x00d\x02\...x00S\x00}\x02\x00\xcc\x12\x00|\x02\x00d\x03\x00k\x02\x00sH\x00t\x02\x00\x82\x01\x00|\x01\x00\x83\x00\x00\x01d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
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_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
co_code = 'd\x01\x00d\x00\x00l\x00\x00\x89\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00\x87\x00\x00\x87\x01\x00f\x02\x00d\x02\...x00S\x00}\x02\x00\xcc\x12\x00|\x02\x00d\x03\x00k\x02\x00sH\x00t\x02\x00\x82\x01\x00|\x01\x00\x83\x00\x00\x01d\x00\x00S'
next_instr = 48L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
@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)
interpreter/pyopcode.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
oparg = 0, next_instr = 48L
def CALL_FUNCTION(self, oparg, next_instr):
# XXX start of hack for performance
if (oparg >> 8) & 0xff == 0:
# Only positional arguments
nargs = oparg & 0xff
w_function = self.peekvalue(nargs)
> w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/pyopcode.py:1233:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <Function f>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
dropvalues = 1, methodcall = False
def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False):
# methodcall is only used for better error messages in argument.py
from pypy.interpreter.function import Function, Method, is_builtin_code
if frame.get_is_being_profiled() and is_builtin_code(w_func):
# XXX: this code is copied&pasted :-( from the slow path below
# call_valuestack().
args = frame.make_arguments(nargs)
frame.dropvalues(dropvalues)
return self.call_args_and_c_profile(frame, w_func, args)
if not self.config.objspace.disable_call_speedhacks:
# start of hack for performance
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
methodcall = True
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
return w_func.funccall_valuestack(
> nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/baseobjspace.py:1243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function f>, nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
dropvalues = 1, methodcall = False
def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack
# methodcall is only for better error messages
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
#
if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info
and nargs == 0):
frame.dropvalues(dropvalues)
from pypy.module.sys.vm import exc_info_direct
return exc_info_direct(self.space, frame)
#
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
f_0 = frame.peekvalue(0)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, f_0)
elif nargs == 2:
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
frame.dropvalues(dropvalues)
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, f_1, f_0)
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
frame.dropvalues(dropvalues)
return code.fastcall_3(self.space, self, f_2,
f_1, f_0)
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
f_0 = frame.peekvalue(0)
f_1 = frame.peekvalue(1)
f_2 = frame.peekvalue(2)
f_3 = frame.peekvalue(3)
frame.dropvalues(dropvalues)
return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0)
elif (nargs | Code.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
> return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function f>
code = <code object f, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4>
nargs = 0
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13
dropvalues = 1
@jit.unroll_safe
def _flat_pycall(self, code, nargs, frame, dropvalues):
# code is a PyCode
new_frame = self.space.createframe(code, self.w_func_globals,
self)
for i in xrange(nargs):
new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i)
frame.dropvalues(dropvalues)
> return new_frame.run()
interpreter/function.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11
pycode = <code object f, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11
co_code = 'd\x01\x00t\x00\x00f\x01\x00d\x02\x00\x84\x00\x00\x83\x00\x00Y}\x00\x00\x88\x01\x00\xc9\x01\x00|\x00\x00\xca\x01\x00}\...x00S\x88\x00\x00\xc9\x02\x00\xca\x00\x00\x01\x88\x00\x00\xc9\x02\x00\xca\x00\x00\x01|\x02\x00\xc9\x03\x00\xca\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11
co_code = 'd\x01\x00t\x00\x00f\x01\x00d\x02\x00\x84\x00\x00\x83\x00\x00Y}\x00\x00\x88\x01\x00\xc9\x01\x00|\x00\x00\xca\x01\x00}\...x00S\x88\x00\x00\xc9\x02\x00\xca\x00\x00\x01\x88\x00\x00\xc9\x02\x00\xca\x00\x00\x01|\x02\x00\xc9\x03\x00\xca\x00\x00S'
next_instr = 55L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf349b9ac>
@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 f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11
nameindex = 2, ignored = (55L,)
MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'>
space = StdObjSpace
w_obj = <pypy.module.gc.moduledef.Module object at 0xf342e5cc>
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 0xf342e5cc>
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 0xf342e5cc>
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
_________________ TestW_IntObject.test_lshift_without_fromint __________________
self = <pypy.objspace.std.test.test_intobject.TestW_IntObject instance at 0xf1f3c7ec>
monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0xf1f3c52c>
def test_lshift_without_fromint(self, monkeypatch):
space = self.space
monkeypatch.setattr(rbigint, 'fromint', None)
x = sys.maxint // 4
y = 16
f1 = iobj.W_IntObject(x)
f2 = iobj.W_IntObject(y)
> v = f1.descr_lshift(space, f2)
objspace/std/test/test_intobject.py:361:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
objspace/std/intobject.py:620: in descr_binop
return ovf2long(space, x, self, y, w_other)
objspace/std/intobject.py:645: in _ovf2long_lshift
return space.newlong_from_rbigint(rbigint.lshift_int_int_bigint_result(x, y))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iself = 536870911, int_other = 16
@staticmethod
@jit.elidable
def lshift_int_int_bigint_result(iself, int_other):
if not SUPPORT_INT128 or SHIFT != 63 or not int_in_valid_range(iself):
> return rbigint.fromint(iself).lshift(int_other)
E TypeError: 'NoneType' object is not callable
../rpython/rlib/rbigint.py:1383: TypeError
=========================== short test summary info ============================
FAIL objspace/std/test/apptest_iterobject.py::test_reversed_frees_empty
FAIL objspace/std/test/apptest_userobject.py::test_del
FAIL objspace/std/test/apptest_userobject.py::test_del_exception
FAIL objspace/std/test/test_intobject.py::TestW_IntObject::()::test_lshift_without_fromint
FAIL objspace/std/test/test_mapdict.py::AppTestWithMapDictAndCounters::()::test_dont_keep_class_alive
FAIL objspace/std/test/test_mapdict.py::AppTestWithMapDictAndCounters::()::test_instance_keeps_class_alive
FAIL objspace/std/test/test_smalllongobject.py::TestW_IntObject::()::test_lshift_without_fromint
============= 7 failed, 2085 passed, 38 skipped in 675.42 seconds ==============
program finished with exit code 1
elapsedTime=4538.114432