virt_test\Scripts\python.exe testrunner/runner.py --logfile=testrun.log --config=pypy/testrunner_cfg.py --config=~/machine_cfg.py --root=pypy --timeout=4000
in dir d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build (timeout 4000 secs)
watching logfiles {'pytestLog': 'testrun.log'}
argv: ['virt_test\\Scripts\\python.exe', 'testrunner/runner.py', '--logfile=testrun.log', '--config=pypy/testrunner_cfg.py', '--config=~/machine_cfg.py', '--root=pypy', '--timeout=4000']
environment:
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\matti\AppData\Roaming
ASL.LOG=Destination=file
CHOCOLATEYINSTALL=C:\ProgramData\chocolatey
CHOCOLATEYLASTPATHUPDATE=133185086718935289
CHOCOLATEYTOOLSLOCATION=C:\tools
CLINK_DIR=C:\Program Files (x86)\clink\0.4.9
COMMONPROGRAMFILES=C:\Program Files (x86)\Common Files
COMMONPROGRAMFILES(X86)=C:\Program Files (x86)\Common Files
COMMONPROGRAMW6432=C:\Program Files\Common Files
COMPUTERNAME=DESKTOP-RYZEN
COMSPEC=C:\WINDOWS\system32\cmd.exe
CONDA_BAT=d:\miniconda\condabin\conda.bat
CONDA_EXE=d:\miniconda\Scripts\conda.exe
CONDA_SHLVL=0
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7
CUDA_PATH_V11_7=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7
DRIVERDATA=C:\Windows\System32\Drivers\DriverData
LOCALAPPDATA=C:\Users\matti\AppData\Local
NUMBER_OF_PROCESSORS=2
NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
OS=Windows_NT
PATH=d:\CPython27\lib\site-packages\pywin32_system32;d:\pypy_stuff\pypy\externals\bin;D:\CPython27;D:\pypy_stuff\pypy2.7-v7.3.18\Scripts;D:\pypy_stuff\pypy2.7-v7.3.18;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseHg\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\WINDOWS\System32\OpenSSH
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_ARCHITEW6432=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD
PROCESSOR_LEVEL=23
PROCESSOR_REVISION=7100
PROGRAMDATA=C:\ProgramData
PROGRAMFILES=C:\Program Files (x86)
PROGRAMFILES(X86)=C:\Program Files (x86)
PROGRAMW6432=C:\Program Files
PROMPT=$P$G
PSMODULEPATH=%ProgramFiles%\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
PWD=d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build
PYPYCHERRYPICK=
PYPY_ENABLE_WINCONSOLEIO=1
PYTEST_XDIST_AUTO_NUM_WORKERS=4
PYTHONPATH=.;
RTOOLS40_HOME=C:\rtools40
RTOOLS43_HOME=C:\rtools43
RTOOLS44_HOME=C:\rtools44
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINDOWS
TEMP=D:\SystemTemp
TMP=D:\SystemTemp
TMPDIR=d:\systemtemp\pytest
USERDOMAIN=DESKTOP-RYZEN
USERNAME=matti
USERPROFILE=C:\Users\matti
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
WINDIR=C:\WINDOWS
using PTY: False
using config pypy/testrunner_cfg.py
using config C:\Users\matti/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
++ 01:00:49 starting config/test [1 started in total]
++ 01:00:49 starting interpreter/astcompiler/test [2 started in total]
++ 01:00:49 starting interpreter/pyparser/test [3 started in total]
++ 01:00:49 starting interpreter/test [4 started in total]
__ config/test [1 done in total, somefailed=False] ____________________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.py
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 157 items / 1 skipped
config\test\test_pypyoption.py .............................................................................................................................................................
=================== 157 passed, 1 skipped in 65.22 seconds ====================
++ 01:02:03 starting module/__builtin__/test [5 started in total]
__ interpreter/pyparser/test [2 done in total, somefailed=False] ______________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 97.95 seconds =========================
++ 01:02:32 starting module/__pypy__/test [6 started in total]
__ interpreter/astcompiler/test [3 done in total, somefailed=False] ___________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
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 123.03 seconds =========================
++ 01:02:54 starting module/_ast/test [7 started in total]
__ module/__builtin__/test [4 done in total, somefailed=False] ________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
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 ...........................................................
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 .........
=================== 304 passed, 1 skipped in 55.26 seconds ====================
++ 01:03:02 starting module/_cffi_backend/test [8 started in total]
__ module/_ast/test [5 done in total, somefailed=False] _______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 36 items
module\_ast\test\test_ast.py ....................................
========================= 36 passed in 31.73 seconds ==========================
++ 01:03:27 starting module/_codecs/test [9 started in total]
__ module/__pypy__/test [6 done in total, somefailed=True] ____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 ...F...
module\__pypy__\test\test_identitydict.py ......
module\__pypy__\test\test_intop.py ...........
module\__pypy__\test\test_locals2fast.py .....
module\__pypy__\test\test_magic.py .......
module\__pypy__\test\test_newmemoryview.py ...
module\__pypy__\test\test_os.py .
module\__pypy__\test\test_signal.py ...ss
module\__pypy__\test\test_special.py ............s
module\__pypy__\test\test_time.py sss
================================== FAILURES ===================================
___________________ AppTestDebug.test_debug_read_timestamp ____________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x000001d1c8e4ac98>
def test_debug_read_timestamp(self):
from __pypy__ import debug_read_timestamp
a = debug_read_timestamp()
b = debug_read_timestamp()
> assert b > a
E (application-level) AssertionError: assert 890564492960499968 > 890564492960499968
[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\__pypy__\test\test_debug.py:52]:5: AssertionError
=========================== short test summary info ===========================
FAIL module\__pypy__\test\test_debug.py::AppTestDebug::()::test_debug_read_timestamp
=============== 1 failed, 61 passed, 6 skipped in 60.78 seconds ===============
++ 01:03:40 starting module/_continuation/test [10 started in total]
__ module/_codecs/test [7 done in total, somefailed=False] ____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 62.92 seconds ==========================
++ 01:04:34 starting module/_cppyy/test [11 started in total]
__ module/_cppyy/test [8 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items
======================== no tests ran in 0.01 seconds =========================
++ 01:04:35 starting module/_csv/test [12 started in total]
__ module/_continuation/test [9 done in total, somefailed=False] ______________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 81 items / 1 skipped
module\_continuation\test\test_generator.py ssss
module\_continuation\test\test_greenlet.py s.ssssss.sssssssssssssss.sss
module\_continuation\test\test_translated.py sssssssssssssssssssssssssssss
module\_continuation\test\test_zpickle.py ssssssssssssssssssss
==================== 3 passed, 79 skipped in 81.45 seconds ====================
++ 01:05:09 starting module/_demo/test [13 started in total]
__ module/_csv/test [10 done in total, somefailed=False] ______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 46.34 seconds ==========================
++ 01:05:27 starting module/_file/test [14 started in total]
__ module/_demo/test [11 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 23.67 seconds ==========================
++ 01:05:38 starting module/_io/test [15 started in total]
__ module/_file/test [12 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 269 items
module\_file\test\test_file.py .....................ss..sss......
module\_file\test\test_file_extra.py ..................................................................................................................................................................ss..............ss..............ss..............ss...........s......s.s
module\_file\test\test_large_file.py .s
=================== 252 passed, 17 skipped in 77.54 seconds ===================
++ 01:06:49 starting module/_jitlog/test [16 started in total]
__ module/_jitlog/test [13 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items
module\_jitlog\test\test__jitlog.py s
========================= 1 skipped in 58.48 seconds ==========================
++ 01:07:49 starting module/_locale/test [17 started in total]
__ module/_io/test [14 done in total, somefailed=False] _______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
collected 200 items
module\_io\test\apptest_bytesio.py ............
module\_io\test\apptest_io.py ................................
module\_io\test\apptest_stringio.py .........................
module\_io\test\apptest_textio.py ...........................
module\_io\test\test_bufferedio.py ..............................................................................
module\_io\test\test_fileio.py ...............s......
module\_io\test\test_interp_textio.py ....
=================== 199 passed, 1 skipped in 126.33 seconds ===================
++ 01:07:50 starting module/_lsprof/test [18 started in total]
__ module/_locale/test [15 done in total, somefailed=True] ____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 14 items
module\_locale\test\test_locale.py .......F.ssss.
================================== FAILURES ===================================
______________________ AppTestLocaleTrivia.test_strxfrm _______________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x0000024deb2f7c58>
def test_strxfrm(self):
# TODO more tests would be nice
import _locale
_locale.setlocale(_locale.LC_ALL, "C")
a = "1234"
b = _locale.strxfrm(a)
> assert a is not b
E (application-level) AssertionError: assert '1234' is not '1234'
[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\_locale\test\test_locale.py:186]:8: AssertionError
=========================== short test summary info ===========================
FAIL module\_locale\test\test_locale.py::AppTestLocaleTrivia::()::test_strxfrm
=============== 1 failed, 9 passed, 4 skipped in 30.23 seconds ================
++ 01:08:23 starting module/_md5/test [19 started in total]
__ module/_lsprof/test [16 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module\_lsprof\test\test_cprofile.py ......
========================== 6 passed in 43.67 seconds ==========================
++ 01:08:36 starting module/_minimal_curses/test [20 started in total]
__ module/_md5/test [17 done in total, somefailed=False] ______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module\_md5\test\test_md5.py .s....
==================== 5 passed, 1 skipped in 68.89 seconds =====================
++ 01:09:37 starting module/_multibytecodec/test [21 started in total]
__ module/_minimal_curses/test [18 done in total, somefailed=False] ___________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
module\_minimal_curses\test\test_curses.py ssssss
========================= 6 skipped in 65.51 seconds ==========================
++ 01:09:50 starting module/_multiprocessing/test [22 started in total]
__ module/_multibytecodec/test [19 done in total, somefailed=False] ___________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 86.41 seconds ====================
++ 01:11:06 starting module/_pypyjson/test [23 started in total]
__ module/_pypyjson/test [20 done in total, somefailed=False] _________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 45 items
module\_pypyjson\test\test__pypyjson.py ..........................................
module\_pypyjson\test\test_simd.py ...
========================= 45 passed in 32.72 seconds ==========================
++ 01:11:46 starting module/_random/test [24 started in total]
__ module/_multiprocessing/test [21 done in total, somefailed=False] __________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 24 items
module\_multiprocessing\test\test_connection.py ...........
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 ..
module\_multiprocessing\test\test_ztranslation.py .
========================= 24 passed in 202.73 seconds =========================
++ 01:13:16 starting module/_rawffi/alt/test [25 started in total]
__ module/_random/test [22 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 135.23 seconds =========================
++ 01:14:06 starting module/_rawffi/test [26 started in total]
__ interpreter/test [23 done in total, somefailed=True] _______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
collected 772 items
interpreter\test\apptest_class.py ...............
interpreter\test\apptest_exec.py ............................
interpreter\test\apptest_function.py ........................s..............................
interpreter\test\apptest_generator.py ..................................
interpreter\test\apptest_nestedscope.py .............
interpreter\test\apptest_pyframe.py .............................
interpreter\test\apptest_raise.py .....................
interpreter\test\test_app_main.py ....ssssssssssssssssssssssssssssssssss.............s......s...F..
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 ..................
interpreter\test\test_unicodehelper.py ..........
interpreter\test\test_zpy.py ....sF
interpreter\test\test_zzpickle_and_slow.py ...............s...................
================================== FAILURES ===================================
__________________ AppTestAppMain.test_setup_bootstrap_path ___________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x000001e7c2735c90>
def test_setup_bootstrap_path(self):
# Check how sys.path is handled depending on if we can find a copy of
# the stdlib in setup_bootstrap_path.
import sys, os
old_sys_path = sys.path[:]
old_cwd = os.getcwd()
# make sure cwd does not contain a stdlib
if self.tmp_dir.startswith(self.trunkdir):
skip('TMPDIR is inside the PyPy source')
sys.path.append(self.goal_dir)
tmp_pypy_c = os.path.join(self.tmp_dir, 'pypy-c')
try:
os.chdir(self.tmp_dir)
# If we are running PyPy with a libpypy-c, the following
# lines find the stdlib anyway. Otherwise, it is not found.
expected_found = (
getattr(sys, 'pypy_translation_info', {})
.get('translation.shared'))
import app_main
app_main.setup_bootstrap_path(tmp_pypy_c)
> assert sys.executable == ''
E (application-level) AssertionError: assert 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\virt_test\\Scripts\\python.exe' == ''
E + where 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\virt_test\\Scripts\\python.exe' = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\virt_test\\Scripts\\python.exe'
E + where 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\virt_test\\Scripts\\python.exe' = <module 'sys' (built-in)>.executable
[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\interpreter\test\test_app_main.py:1036]:24: AssertionError
________________________________ test_pytrace _________________________________
def test_pytrace():
output = run(sys.executable, pypypath, '-S',
stdin="__pytrace__ = 1\nx = 5\nx")
assert ('\t<module>: LOAD_CONST 0 (5)\n'
'\t<module>: STORE_NAME 0 (x)\n'
'\t<module>: LOAD_CONST 1 (None)\n'
'\t<module>: RETURN_VALUE 0 \n'
> '>>>> ') in output
E assert '\t<module>: LOAD_CONST 0 (5)\n\t<module>: STORE_NAME 0 (x)\n\t<module>: LOAD_CONST 1 (None)\n\t<module>: RETURN_VALUE 0 \n>>>> ' in '>>>> Tracing enabled\r\n>>>> \t<module>: LOAD_CONST 0 (5)\r\n\t<module>: STORE_NAME 0 (x)\r...T_EXPR 0 5\r\n\r\n\t<module>: LOAD_CONST 0 (None)\r\n\t<module>: RETURN_VALUE 0 \r\n>>>> '
interpreter\test\test_zpy.py:114: AssertionError
---------------------------- Captured stderr call -----------------------------
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
PyPy 7.3.24-alpha0 in StdObjSpace on top of Python 2.7.18 (startuptime: 46.66 secs)
=========================== short test summary info ===========================
FAIL interpreter\test\test_app_main.py::AppTestAppMain::()::test_setup_bootstrap_path
FAIL interpreter\test\test_zpy.py::test_pytrace
============= 2 failed, 729 passed, 41 skipped in 820.59 seconds ==============
++ 01:14:32 starting module/_sha/test [27 started in total]
__ module/_sha/test [24 done in total, somefailed=False] ______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 6 items
module\_sha\test\test_sha.py .s....
==================== 5 passed, 1 skipped in 32.33 seconds =====================
++ 01:15:06 starting module/_socket/test [28 started in total]
__ module/_rawffi/alt/test [25 done in total, somefailed=False] _______________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 ..s..............................ss.ss....
module\_rawffi\alt\test\test_struct.py ...............
module\_rawffi\alt\test\test_type_converter.py ...........
=================== 68 passed, 5 skipped in 113.87 seconds ====================
++ 01:15:15 starting module/_sre/test [29 started in total]
__ module/_rawffi/test [26 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
collected 83 items
module\_rawffi\test\apptest_rawffi.py .
module\_rawffi\test\test__rawffi.py .................s.................................s................
module\_rawffi\test\test_exit.py s
module\_rawffi\test\test_nested.py ......
module\_rawffi\test\test_struct.py ...
module\_rawffi\test\test_tracker.py ...
module\_rawffi\test\test_ztranslation.py .
=================== 80 passed, 3 skipped in 118.12 seconds ====================
n: 2
Arg 0: 3
Arg 1: 15
++ 01:16:12 starting module/_vmprof/test [30 started in total]
__ module/_vmprof/test [27 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items
======================== no tests ran in 0.00 seconds =========================
++ 01:16:13 starting module/_warnings/test [31 started in total]
__ module/_sre/test [28 done in total, somefailed=False] ______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 139 items
module\_sre\test\test_app_sre.py ...................................................................................................................
module\_sre\test\test_sre_buf.py ........................
========================= 139 passed in 90.90 seconds =========================
++ 01:16:52 starting module/_weakref/test [32 started in total]
__ module/_cffi_backend/test [29 done in total, somefailed=True] ______________
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 466 items
module\_cffi_backend\test\test_c.py s..............................................................................ssss.s....................................................s.....s...................sss...........................s...s........................s......
module\_cffi_backend\test\test_fastpath.py ..................
module\_cffi_backend\test\test_ffi_obj.py .............................................
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 .................s..
module\_cffi_backend\test\test_recompiler.py ..........F..................F...........................................................s..s............ssss..s.s.ss.......
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 ===================================
__________________ AppTestRecompiler.test_macro_check_value ___________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x0000022fbf0861e0>
def test_macro_check_value(self):
# the value '-0x80000000' in C sources does not have a clear meaning
# to me; it appears to have a different effect than '-2147483648'...
# Moreover, on 32-bits, -2147483648 is actually equal to
# -2147483648U, which in turn is equal to 2147483648U and so positive.
import sys
vals = ['42', '-42', '0x80000000', '-2147483648',
'0', '9223372036854775809ULL',
'-9223372036854775807LL']
if sys.maxsize <= 2**32:
vals.remove('-2147483648')
cdef_lines = ['#define FOO_%d_%d %s' % (i, j, vals[i])
for i in range(len(vals))
for j in range(len(vals))]
verify_lines = ['#define FOO_%d_%d %s' % (i, j, vals[j]) # [j], not [i]
for i in range(len(vals))
for j in range(len(vals))]
ffi, lib = self.prepare(
'\n'.join(cdef_lines),
'test_macro_check_value_ok',
'\n'.join(verify_lines))
for j in range(len(vals)):
c_got = int(vals[j].replace('U', '').replace('L', ''), 0)
c_compiler_msg = str(c_got)
if c_got > 0:
c_compiler_msg += ' (0x%x)' % (c_got,)
#
for i in range(len(vals)):
attrname = 'FOO_%d_%d' % (i, j)
if i == j:
x = getattr(lib, attrname)
assert x == c_got
else:
> e = raises(ffi.error, getattr, lib, attrname)
E (application-level) AssertionError: DID NOT RAISE
[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\_cffi_backend\test\test_recompiler.py:220]:38: AssertionError
---------------------------- Captured stdout call -----------------------------
generating d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c
_CFFI_test_macro_check_value_ok.c
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(658): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(659): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(721): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(722): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(784): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(785): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(822): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(831): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(840): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(847): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(848): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(849): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(858): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(867): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(876): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(910): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(911): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(973): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(974): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(1036): warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.c(1037): warning C4146: unary minus operator applied to unsigned type, result still unsigned
Creating library d:\systemtemp\pytest\usession-main-1173\recompiler\Release\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.pypy-73.lib and object d:\systemtemp\pytest\usession-main-1173\recompiler\Release\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_macro_check_value_ok.pypy-73.exp
Generating code
Finished generating code
__________ AppTestRecompiler.test_verify_anonymous_enum_with_typedef __________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x0000022fbf0861e0>
def test_verify_anonymous_enum_with_typedef(self):
ffi, lib = self.prepare(
"typedef enum { AA, ... } e1;",
'test_verify_anonymous_enum_with_typedef1',
"typedef enum { BB, CC, AA } e1;")
assert lib.AA == 2
assert ffi.sizeof("e1") == ffi.sizeof("int")
assert repr(ffi.cast("e1", 2)) == "<cdata 'e1' 2: AA>"
#
import sys
ffi, lib = self.prepare(
"typedef enum { AA=%d } e1;" % sys.maxsize,
'test_verify_anonymous_enum_with_typedef2',
"typedef enum { AA=%d } e1;" % sys.maxsize)
> assert lib.AA == sys.maxsize
E (application-level) AssertionError: assert -1 == 9223372036854775807
E + where -1 = -1
E + where -1 = <Lib object for '_CFFI_test_verify_anonymous_enum_with_typedef2'>.AA
E + and 9223372036854775807 = 9223372036854775807
E + where 9223372036854775807 = <module 'sys' (built-in)>.maxsize
[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\_cffi_backend\test\test_recompiler.py:495]:15: AssertionError
---------------------------- Captured stdout call -----------------------------
generating d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_verify_anonymous_enum_with_typedef1.c
_CFFI_test_verify_anonymous_enum_with_typedef1.c
Creating library d:\systemtemp\pytest\usession-main-1173\recompiler\Release\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_verify_anonymous_enum_with_typedef1.pypy-73.lib and object d:\systemtemp\pytest\usession-main-1173\recompiler\Release\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_verify_anonymous_enum_with_typedef1.pypy-73.exp
Generating code
Finished generating code
generating d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_verify_anonymous_enum_with_typedef2.c
_CFFI_test_verify_anonymous_enum_with_typedef2.c
d:\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_verify_anonymous_enum_with_typedef2.c(573): warning C4309: 'initializing': truncation of constant value
Creating library d:\systemtemp\pytest\usession-main-1173\recompiler\Release\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_verify_anonymous_enum_with_typedef2.pypy-73.lib and object d:\systemtemp\pytest\usession-main-1173\recompiler\Release\systemtemp\pytest\usession-main-1173\recompiler\_CFFI_test_verify_anonymous_enum_with_typedef2.pypy-73.exp
Generating code
Finished generating code
=========================== short test summary info ===========================
FAIL module\_cffi_backend\test\test_recompiler.py::AppTestRecompiler::()::test_macro_check_value
FAIL module\_cffi_backend\test\test_recompiler.py::AppTestRecompiler::()::test_verify_anonymous_enum_with_typedef
============= 2 failed, 436 passed, 28 skipped in 827.24 seconds ==============
++ 01:16:53 starting module/_winreg/test [33 started in total]
__ module/_warnings/test [30 done in total, somefailed=False] _________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
collected 12 items
module\_warnings\test\apptest_warnings.py ...........
module\_warnings\test\test_warnings.py .
========================= 12 passed in 100.04 seconds =========================
++ 01:17:57 starting module/array/test [34 started in total]
__ module/_socket/test [31 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 60 items
module\_socket\test\test_sock_app.py .......s..........s.............s...........s.s.ss.........
module\_socket\test\test_ztranslation.py .
=================== 53 passed, 7 skipped in 177.18 seconds ====================
++ 01:18:11 starting module/binascii/test [35 started in total]
__ module/_weakref/test [32 done in total, somefailed=False] __________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 42 items
module\_weakref\test\test_weakref.py ....................s.....................
==================== 41 passed, 1 skipped in 83.59 seconds ====================
++ 01:18:22 starting module/bz2/test [36 started in total]
__ module/_winreg/test [33 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 18 items
module\_winreg\test\test_winreg.py ............s..ss.
==================== 15 passed, 3 skipped in 82.96 seconds ====================
++ 01:18:22 starting module/cStringIO/test [37 started in total]
__ module/bz2/test [34 done in total, somefailed=False] _______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items / 2 skipped
module\bz2\test\test_large.py s
========================= 3 skipped in 57.21 seconds ==========================
++ 01:19:22 starting module/cmath/test [38 started in total]
__ module/binascii/test [35 done in total, somefailed=False] __________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 14 items
module\binascii\test\test_binascii.py ..............
========================= 14 passed in 87.32 seconds ==========================
++ 01:19:41 starting module/cpyext/test/test_abstract.py [39 started in total]
__ module/array/test [36 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 49 items
module\array\test\test_array.py ....................................s...........
module\array\test\test_ztranslation.py .
==================== 48 passed, 1 skipped in 96.84 seconds ====================
++ 01:19:42 starting module/cpyext/test/test_api.py [40 started in total]
__ module/cStringIO/test [37 done in total, somefailed=False] _________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 75.65 seconds ==========================
++ 01:19:44 starting module/cpyext/test/test_arraymodule.py [41 started in total]
__ module/cmath/test [38 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 15 items
module\cmath\test\test_cmath.py ...............
========================= 15 passed in 39.80 seconds ==========================
++ 01:20:08 starting module/cpyext/test/test_boolobject.py [42 started in total]
__ module/cpyext/test/test_boolobject.py [39 done in total, somefailed=False] _
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.01 seconds ==========================
++ 01:20:33 starting module/cpyext/test/test_borrow.py [43 started in total]
__ module/cpyext/test/test_abstract.py [40 done in total, somefailed=False] ___
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:20:33 starting module/cpyext/test/test_bufferobject.py [44 started in total]
__ module/cpyext/test/test_api.py [41 done in total, somefailed=False] ________
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:20:34 starting module/cpyext/test/test_bytearrayobject.py [45 started in total]
__ module/cpyext/test/test_arraymodule.py [42 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:20:37 starting module/cpyext/test/test_bytesobject.py [46 started in total]
__ module/cpyext/test/test_borrow.py [43 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:21:07 starting module/cpyext/test/test_capsule.py [47 started in total]
__ module/cpyext/test/test_bufferobject.py [44 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.01 seconds ==========================
++ 01:21:07 starting module/cpyext/test/test_cell.py [48 started in total]
__ module/cpyext/test/test_bytearrayobject.py [45 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:21:08 starting module/cpyext/test/test_classobject.py [49 started in total]
__ module/cpyext/test/test_bytesobject.py [46 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:21:16 starting module/cpyext/test/test_codecs.py [50 started in total]
__ module/cpyext/test/test_classobject.py [47 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:21:42 starting module/cpyext/test/test_complexobject.py [51 started in total]
__ module/cpyext/test/test_codecs.py [48 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:21:45 starting module/cpyext/test/test_cpyext.py [52 started in total]
__ module/cpyext/test/test_capsule.py [49 done in total, somefailed=False] ____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.09 seconds ==========================
++ 01:21:46 starting module/cpyext/test/test_datetime.py [53 started in total]
__ module/cpyext/test/test_cell.py [50 done in total, somefailed=False] _______
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.01 seconds ==========================
++ 01:21:46 starting module/cpyext/test/test_dictobject.py [54 started in total]
__ module/cpyext/test/test_dictobject.py [51 done in total, somefailed=False] _
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:22:20 starting module/cpyext/test/test_eval.py [55 started in total]
__ module/cpyext/test/test_complexobject.py [52 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:22:21 starting module/cpyext/test/test_fileobject.py [56 started in total]
__ module/cpyext/test/test_cpyext.py [53 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:22:25 starting module/cpyext/test/test_floatobject.py [57 started in total]
__ module/cpyext/test/test_datetime.py [54 done in total, somefailed=False] ___
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:22:25 starting module/cpyext/test/test_frameobject.py [58 started in total]
__ module/cpyext/test/test_fileobject.py [55 done in total, somefailed=False] _
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.01 seconds ==========================
++ 01:22:55 starting module/cpyext/test/test_funcobject.py [59 started in total]
__ module/cpyext/test/test_eval.py [56 done in total, somefailed=False] _______
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.01 seconds ==========================
++ 01:22:59 starting module/cpyext/test/test_genobject.py [60 started in total]
__ module/cpyext/test/test_frameobject.py [57 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:23:04 starting module/cpyext/test/test_getargs.py [61 started in total]
__ module/cpyext/test/test_floatobject.py [58 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:23:04 starting module/cpyext/test/test_import.py [62 started in total]
__ module/cpyext/test/test_funcobject.py [59 done in total, somefailed=False] _
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.04 seconds ==========================
++ 01:23:34 starting module/cpyext/test/test_intobject.py [63 started in total]
__ module/cpyext/test/test_genobject.py [60 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:23:38 starting module/cpyext/test/test_iterator.py [64 started in total]
__ module/cpyext/test/test_getargs.py [61 done in total, somefailed=False] ____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:23:43 starting module/cpyext/test/test_listobject.py [65 started in total]
__ module/cpyext/test/test_import.py [62 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:23:43 starting module/cpyext/test/test_longobject.py [66 started in total]
__ module/cpyext/test/test_iterator.py [63 done in total, somefailed=False] ___
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:24:12 starting module/cpyext/test/test_mapping.py [67 started in total]
__ module/cpyext/test/test_intobject.py [64 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:24:13 starting module/cpyext/test/test_marshal.py [68 started in total]
__ module/cpyext/test/test_listobject.py [65 done in total, somefailed=False] _
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:24:22 starting module/cpyext/test/test_memoryobject.py [69 started in total]
__ module/cpyext/test/test_longobject.py [66 done in total, somefailed=False] _
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:24:22 starting module/cpyext/test/test_methodobject.py [70 started in total]
__ module/cpyext/test/test_mapping.py [67 done in total, somefailed=False] ____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:24:46 starting module/cpyext/test/test_misc.py [71 started in total]
__ module/cpyext/test/test_marshal.py [68 done in total, somefailed=False] ____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:24:52 starting module/cpyext/test/test_module.py [72 started in total]
__ module/cpyext/test/test_memoryobject.py [69 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:25:01 starting module/cpyext/test/test_ndarrayobject.py [73 started in total]
__ module/cpyext/test/test_methodobject.py [70 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.03 seconds ==========================
++ 01:25:01 starting module/cpyext/test/test_number.py [74 started in total]
__ module/cpyext/test/test_misc.py [71 done in total, somefailed=False] _______
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.03 seconds ==========================
++ 01:25:19 starting module/cpyext/test/test_object.py [75 started in total]
__ module/cpyext/test/test_module.py [72 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.03 seconds ==========================
++ 01:25:26 starting module/cpyext/test/test_pycobject.py [76 started in total]
__ module/cpyext/test/test_ndarrayobject.py [73 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.04 seconds ==========================
++ 01:25:40 starting module/cpyext/test/test_pyerrors.py [77 started in total]
__ module/cpyext/test/test_number.py [74 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:25:40 starting module/cpyext/test/test_pyfile.py [78 started in total]
__ module/cpyext/test/test_object.py [75 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:25:58 starting module/cpyext/test/test_pysignals.py [79 started in total]
__ module/cpyext/test/test_pycobject.py [76 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:25:59 starting module/cpyext/test/test_pystate.py [80 started in total]
__ module/cpyext/test/test_pyerrors.py [77 done in total, somefailed=False] ___
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:26:13 starting module/cpyext/test/test_pystrtod.py [81 started in total]
__ module/cpyext/test/test_pyfile.py [78 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:26:14 starting module/cpyext/test/test_sequence.py [82 started in total]
__ module/cpyext/test/test_pysignals.py [79 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.01 seconds ==========================
++ 01:26:37 starting module/cpyext/test/test_setobject.py [83 started in total]
__ module/cpyext/test/test_pystate.py [80 done in total, somefailed=False] ____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:26:38 starting module/cpyext/test/test_sliceobject.py [84 started in total]
__ module/cpyext/test/test_pystrtod.py [81 done in total, somefailed=False] ___
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:26:47 starting module/cpyext/test/test_structseq.py [85 started in total]
__ module/cpyext/test/test_sequence.py [82 done in total, somefailed=False] ___
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:26:48 starting module/cpyext/test/test_sysmodule.py [86 started in total]
__ module/cpyext/test/test_sliceobject.py [83 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.13 seconds ==========================
++ 01:27:17 starting module/cpyext/test/test_thread.py [87 started in total]
__ module/cpyext/test/test_structseq.py [84 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:27:21 starting module/cpyext/test/test_traceback.py [88 started in total]
__ module/cpyext/test/test_sysmodule.py [85 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:27:22 starting module/cpyext/test/test_translate.py [89 started in total]
__ module/cpyext/test/test_setobject.py [86 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:27:22 starting module/cpyext/test/test_tupleobject.py [90 started in total]
__ module/cpyext/test/test_thread.py [87 done in total, somefailed=False] _____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.12 seconds ==========================
++ 01:27:56 starting module/cpyext/test/test_typeobject.py [91 started in total]
__ module/cpyext/test/test_traceback.py [88 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:28:01 starting module/cpyext/test/test_unicodeobject.py [92 started in total]
__ module/cpyext/test/test_translate.py [89 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.07 seconds ==========================
++ 01:28:01 starting module/cpyext/test/test_userslots.py [93 started in total]
__ module/cpyext/test/test_tupleobject.py [90 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:28:01 starting module/cpyext/test/test_version.py [94 started in total]
__ module/cpyext/test/test_unicodeobject.py [91 done in total, somefailed=False]
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.01 seconds ==========================
++ 01:28:40 starting module/cpyext/test/test_weakref.py [95 started in total]
__ module/cpyext/test/test_userslots.py [92 done in total, somefailed=False] __
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:28:41 starting module/crypt/test [96 started in total]
__ module/cpyext/test/test_version.py [93 done in total, somefailed=False] ____
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.02 seconds ==========================
++ 01:28:41 starting module/errno/test [97 started in total]
__ module/cpyext/test/test_typeobject.py [94 done in total, somefailed=False] _
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.01 seconds ==========================
++ 01:28:42 starting module/exceptions/test [98 started in total]
__ module/crypt/test [95 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.03 seconds ==========================
++ 01:28:43 starting module/faulthandler/test [99 started in total]
__ module/faulthandler/test [96 done in total, somefailed=False] ______________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 1 items / 1 skipped
module\faulthandler\test\test_ztranslation.py .
==================== 1 passed, 1 skipped in 10.22 seconds =====================
++ 01:28:56 starting module/fcntl/test [100 started in total]
__ module/fcntl/test [97 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 1.66 seconds ==========================
++ 01:29:01 starting module/gc/test [101 started in total]
__ module/errno/test [98 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items
module\errno\test\test_errno.py ...
========================== 3 passed in 21.45 seconds ==========================
++ 01:29:06 starting module/imp/test [102 started in total]
__ module/exceptions/test [99 done in total, somefailed=False] ________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 24 items
module\exceptions\test\test_exc.py ........................
========================= 24 passed in 29.76 seconds ==========================
++ 01:29:16 starting module/itertools/test [103 started in total]
__ module/cpyext/test/test_weakref.py [100 done in total, somefailed=False] ___
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 0.03 seconds ==========================
++ 01:29:19 starting module/marshal/test [104 started in total]
__ module/gc/test [101 done in total, somefailed=True] ________________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 30 items
module\gc\test\test_app_referents.py ....
module\gc\test\test_gc.py .....x...
module\gc\test\test_hook.py ........
module\gc\test\test_referents.py ...F....
module\gc\test\test_ztranslation.py .
================================== FAILURES ===================================
_________________ AppTestReferents.test_get_rpy_memory_usage __________________
self = <CallInfo when='call' exception: type object 'W_IntObject' has no attribute '__basicsize__'>
func = <function <lambda> at 0x0000016c76ab9f88>, 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_get_rpy_memory_usage'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_get_rpy_memory_usage'>}
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 0x0000016c717e1670>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x0000016c7309d820>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_get_rpy_memory_usage'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_get_rpy_memory_usage'>}
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 0x0000016c7309d820>]
kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_get_rpy_memory_usage'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_get_rpy_memory_usage'>}
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_get_rpy_memory_usage'>, '__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 0x0000016c76051ce0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...mory_usage'>, '__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 0x0000016c76634220>
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 0x0000016c76634220>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...mory_usage'>, '__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_get_rpy_memory_usage'>, '__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 0x0000016c76051a38>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...mory_usage'>, '__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 0x0000016c766346e0>
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 0x0000016c766346e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...mory_usage'>, '__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_get_rpy_memory_usage'>, '__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_get_rpy_memory_usage'>
def pytest_runtest_call(item):
try:
> item.runtest()
..\_pytest\runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_get_rpy_memory_usage'>
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_get_rpy_memory_usage'>, space = StdObjSpace
target = <function test_get_rpy_memory_usage at 0x0000016c76b5e020>
args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x0000016c765da6b0>)
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 0x0000016c765da6b0>,)
w_func = <Function test_get_rpy_memory_usage>
args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x0000016c765da6b0>
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_get_rpy_memory_usage>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x0000016c765da6b0>,)
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_get_rpy_memory_usage>
args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x0000016c765da6b0>,)
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <code object test_get_rpy_memory_usage, file '[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', 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_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', 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_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', 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_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', line 1> at line 3
e = AttributeError("type object 'W_IntObject' has no attribute '__basicsize__'",)
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_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', 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_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', line 1> at line 3
pycode = <code object test_get_rpy_memory_usage, file '[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', line 1>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x0000016c76891478>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x02\x00\xca\x01\x00}\x02\x00|\x02\x00GH\xcc"\x00d\x03\x00|\x02\x00\x04\x03k\x01\x00o:\x00d\x04\x00k\x01\x00n\x02\x00\x02\x01sE\x00t\x02\x00\x82\x01\x00d\x00\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x0000016c76891478>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', line 1> at line 3
co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x02\x00\xca\x01\x00}\x02\x00|\x02\x00GH\xcc"\x00d\x03\x00|\x02\x00\x04\x03k\x01\x00o:\x00d\x04\x00k\x01\x00n\x02\x00\x02\x01sE\x00t\x02\x00\x82\x01\x00d\x00\x00S'
next_instr = 24L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x0000016c76891478>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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:290:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', line 1> at line 3
oparg = 1, ignored = (24L,), 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 get_rpy_memory_usage>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', 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 get_rpy_memory_usage>, nargs = 1
frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_get_rpy_...-win-x86-64\build\pypy\module\gc\test\test_referents.py:75]', 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)
interpreter\function.py:149:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode1 object at 0x0000016c768566e8>
space = StdObjSpace, w_func = <BuiltinFunction get_rpy_memory_usage>
w1 = W_IntObject(12345)
@signature(sigtypes.self(), sigtypes.any(),
w_root_or_none,
w_root_or_none,
returns=w_root_or_none)
def fastcall_1(self, space, w_func, w1):
try:
w_result = self.fastfunc_1(space, w1)
except DescrMismatch:
return self._type_unwrap_mismatch(space,
Arguments(space, [w1]))
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:893:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode1 object at 0x0000016c768566e8>
space = StdObjSpace
e = AttributeError("type object 'W_IntObject' has no attribute '__basicsize__'",)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode1 object at 0x0000016c768566e8>
space = StdObjSpace, w_func = <BuiltinFunction get_rpy_memory_usage>
w1 = W_IntObject(12345)
@signature(sigtypes.self(), sigtypes.any(),
w_root_or_none,
w_root_or_none,
returns=w_root_or_none)
def fastcall_1(self, space, w_func, w1):
try:
> w_result = self.fastfunc_1(space, w1)
interpreter\gateway.py:888:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_obj = W_IntObject(12345)
def get_rpy_memory_usage(space, w_obj):
"""Return the memory usage of just the given object or GcRef.
This does not include the internal structures of the object."""
gcref = unwrap(space, w_obj)
> size = rgc.get_rpy_memory_usage(gcref)
module\gc\referents.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gcref = _GcRef(W_IntObject(12345))
@not_rpython
def get_rpy_memory_usage(gcref):
# approximate implementation using CPython's type info
Class = type(gcref._x)
> size = Class.__basicsize__
E AttributeError: type object 'W_IntObject' has no attribute '__basicsize__'
..\rpython\rlib\rgc.py:851: AttributeError
=========================== short test summary info ===========================
FAIL module\gc\test\test_referents.py::AppTestReferents::()::test_get_rpy_memory_usage
=============== 1 failed, 28 passed, 1 xfailed in 52.00 seconds ===============
++ 01:30:01 starting module/math/test [105 started in total]
__ module/marshal/test [102 done in total, somefailed=False] __________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 52.89 seconds ==========================
++ 01:30:18 starting module/micronumpy/test [106 started in total]
__ module/micronumpy/test [103 done in total, somefailed=False] _______________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items
======================== no tests ran in 0.01 seconds =========================
++ 01:30:22 starting module/mmap/test [107 started in total]
__ module/itertools/test [104 done in total, somefailed=False] ________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 73 items
module\itertools\test\test_itertools.py ........................................................................
module\itertools\test\test_ztranslation.py .
========================= 73 passed in 93.81 seconds ==========================
++ 01:31:00 starting module/operator/test [108 started in total]
__ module/math/test [105 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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....
=================== 180 passed, 2 skipped in 65.28 seconds ====================
++ 01:31:16 starting module/parser/test [109 started in total]
__ module/mmap/test [106 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 43 items
module\mmap\test\test_mmap.py ....s.................s..............ss..s.
==================== 38 passed, 5 skipped in 70.24 seconds ====================
++ 01:31:39 starting module/posix/test [110 started in total]
__ module/operator/test [107 done in total, somefailed=False] _________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 53.05 seconds ==========================
++ 01:32:02 starting module/pwd/test [111 started in total]
__ module/imp/test [108 done in total, somefailed=False] ______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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............ss..................
=================== 121 passed, 3 skipped in 167.01 seconds ===================
++ 01:32:04 starting module/pyexpat/test [112 started in total]
__ module/parser/test [109 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 7 items
module\parser\test\test_parser.py .......
========================== 7 passed in 54.45 seconds ==========================
++ 01:32:19 starting module/pypyjit/test [113 started in total]
__ module/pwd/test [110 done in total, somefailed=False] ______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 2 skipped
========================= 2 skipped in 20.66 seconds ==========================
++ 01:32:24 starting module/select/test [114 started in total]
__ module/pypyjit/test [111 done in total, somefailed=False] __________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 73.75 seconds ====================
++ 01:33:42 starting module/signal/test [115 started in total]
__ module/posix/test [112 done in total, somefailed=True] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 59 items
module\posix\test\test_posix2.py EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
module\posix\test\test_posix_libfile.py EEEE
module\posix\test\test_ztranslation.py .
=================================== ERRORS ====================================
_____________ ERROR at setup of AppTestPosix.test_posix_is_pypy_s _____________
self = <CallInfo when='setup' exception: CompilationError(out="""
""")>
func = <function <lambda> at 0x000002d008437970>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_posix_is_pypy_s'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_posix_is_pypy_s'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_posix_is_pypy_s'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d008461678>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00845a360>
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 0x000002d00845a360>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 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_posix_is_pypy_s'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d008445f30>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d008445f30>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d008445f30>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d008445f30>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d008dd2330>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0088b33e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0088b33e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0080b37f8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0080b37f8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0080b37f8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0080b37f8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d0080b37f8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008cea3d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008cea3d8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008cea3d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008cea3d8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = CompilationError(out="""
""")
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0091e7408>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0091e7408>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0091e7408>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008...trategy object at 0x000002d008cea3d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008...trategy object at 0x000002d008cea3d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace, e = CompilationError(out="""
""")
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008... 0x000002d008cea3d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008cea3d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d008cea3d8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
rgil.release()
# NB. it is essential that no exception checking occurs here!
if 1:
from rpython.rlib import rposix
rposix._errno_before(1)
if we_are_translated():
res = funcptr(a0, a1, a2)
else:
try: # only when non-translated
res = funcptr(a0, a1, a2)
except:
rgil.acquire()
raise
if 1:
from rpython.rlib import rposix
> rposix._errno_after(1)
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
save_err = 1
@specialize.call_location()
def _errno_after(save_err):
if _WIN32:
if save_err & rffi.RFFI_SAVE_LASTERROR:
err = rwin32._GetLastError()
# careful, setraw() overwrites GetLastError.
# We must read it first, before the errno handling.
if save_err & rffi.RFFI_ALT_ERRNO:
rthread.tlfield_alt_lasterror.setraw(err)
else:
rthread.tlfield_rpy_lasterror.setraw(err)
elif save_err & rffi.RFFI_SAVE_WSALASTERROR:
from rpython.rlib import _rsocket_rffi
err = _rsocket_rffi._WSAGetLastError()
if save_err & rffi.RFFI_ALT_ERRNO:
rthread.tlfield_alt_lasterror.setraw(err)
else:
rthread.tlfield_rpy_lasterror.setraw(err)
if save_err & rffi.RFFI_SAVE_ERRNO:
if save_err & rffi.RFFI_ALT_ERRNO:
rthread.tlfield_alt_errno.setraw(_get_errno())
else:
> rthread.tlfield_rpy_errno.setraw(_get_errno())
..\rpython\rlib\rposix.py:192:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn get_errno>, args = ()
rffi = <module 'rpython.rtyper.lltypesystem.rffi' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\rpython\\rtyper\\lltypesystem\\rffi.pyc'>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError("calling %r with wrong argument number: %r" %
(self._T, args))
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError("calling undefined function")
> return callb(*args)
..\rpython\rtyper\lltypesystem\lltype.py:1384:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0x000002d006337d70>
argvalues = ()
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
cfunc = get_ctypes_callable(self.funcptr, self.calling_conv,
> self.natural_arity)
..\rpython\rtyper\lltypesystem\ll2ctypes.py:1339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn get_errno>, calling_conv = 'c', natural_arity = -1
def get_ctypes_callable(funcptr, calling_conv, natural_arity):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True,
defines=['RPYTHON_LL2CTYPES'],
> symbolic=True)
..\rpython\rtyper\lltypesystem\ll2ctypes.py:1236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ExternalCompilationInfo (pre_include_bits=(), includes=('errno.h', 'stdio.h',...estonly_libraries=(), use_cpp_linker=False, platform=<MsvcPlatform cc=cl.exe>)>
outputfilename = 'd:\\systemtemp\\pytest\\usession-main-1281\\shared_cache\\externmod_4'
ignore_a_files = False, debug_mode = True, defines = ['RPYTHON_LL2CTYPES']
symbolic = True
def compile_shared_lib(self, outputfilename=None, ignore_a_files=False,
debug_mode=True, defines=[], symbolic=False):
self = self.convert_sources_to_files()
if ignore_a_files:
if not [fn for fn in self.link_files if fn.endswith('.a')]:
ignore_a_files = False # there are none
if not self.separate_module_files and not ignore_a_files:
return self # xxx there was some condition about win32 here
else:
#basepath = py.path.local(self.separate_module_files[0]).dirpath()
basepath = udir.join('shared_cache')
if outputfilename is None:
# find more or less unique name there
pth = basepath.join('externmod').new(ext=host.so_ext)
num = 0
while pth.check():
pth = basepath.join(
'externmod_%d' % (num,)).new(ext=host.so_ext)
num += 1
basepath.ensure(dir=1)
outputfilename = str(pth.dirpath().join(pth.purebasename))
d = self._copy_attributes()
if ignore_a_files:
d['link_files'] = [fn for fn in d['link_files']
if not fn.endswith('.a')]
if debug_mode and sys.platform != 'win32':
d['compile_extra'] = d['compile_extra'] + ('-g', '-O0')
d['compile_extra'] = d['compile_extra'] + (
'-DRPY_EXTERN=RPY_EXPORTED',)
for define in defines:
d['compile_extra'] += ('-D%s' % define,)
# On ELF platforms (Linux), prevent symbol interposition: when the host
# interpreter (e.g. pypy2.7) also exports symbols like pypysig_counter,
# the shared lib's own references would otherwise resolve to the host's
# copy via the GOT. -Bsymbolic makes the shared lib bind its own global
# symbol references to its own definitions. Only needed when running
# under a host interpreter (tests), not during translation.
if symbolic and sys.platform not in ('win32', 'darwin'):
d['link_extra'] = d['link_extra'] + ('-Wl,-Bsymbolic',)
self = ExternalCompilationInfo(**d)
lib = str(host.compile([], self, outputfilename=outputfilename,
> standalone=False))
..\rpython\translator\tool\cbuild.py:345:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MsvcPlatform cc=cl.exe>, cfiles = []
eci = <ExternalCompilationInfo (pre_include_bits=(), includes=('errno.h', 'stdio.h',...estonly_libraries=(), use_cpp_linker=False, platform=<MsvcPlatform cc=cl.exe>)>
outputfilename = 'd:\\systemtemp\\pytest\\usession-main-1281\\shared_cache\\externmod_4'
standalone = False
def compile(self, cfiles, eci, outputfilename=None, standalone=True):
> ofiles = self._compile_o_files(cfiles, eci, standalone)
..\rpython\translator\platform\__init__.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MsvcPlatform cc=cl.exe>
cfiles = [local('d:\\systemtemp\\pytest\\usession-main-1281\\module_cache\\module_6.c'), local('d:\\systemtemp\\pytest\\usession-main-1281\\module_cache\\module_7.c')]
eci = <ExternalCompilationInfo (pre_include_bits=(), includes=('errno.h', 'stdio.h',...estonly_libraries=(), use_cpp_linker=False, platform=<MsvcPlatform cc=cl.exe>)>
standalone = False
def _compile_o_files(self, cfiles, eci, standalone=True):
cfiles = self._all_cfiles(cfiles, eci)
compile_args = self._compile_args_from_eci(eci, standalone)
ofiles = []
for cfile in cfiles:
# Windows hack: use masm for files ending in .asm
if str(cfile).lower().endswith('.asm'):
ofiles.append(self._compile_c_file(self.masm, cfile, []))
else:
> ofiles.append(self._compile_c_file(self.cc, cfile, compile_args))
..\rpython\translator\platform\__init__.py:79:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MsvcPlatform cc=cl.exe>, cc = 'cl.exe'
cfile = local('d:\\systemtemp\\pytest\\usession-main-1281\\module_cache\\module_6.c')
compile_args = ['/MD', '/O2', '-DRPY_EXTERN=RPY_EXPORTED', '-DRPYTHON_LL2CTYPES', '/Fdd:\\systemtemp\\pytest\\usession-main-1281\\module_cache\\']
def _compile_c_file(self, cc, cfile, compile_args):
oname = self._make_o_file(cfile, ext='obj')
# notabene: (tismer)
# This function may be called for .c but also .asm files.
# The c compiler accepts any order of arguments, while
# the assembler still has the old behavior that all options
# must come first, and after the file name all options are ignored.
# So please be careful with the order of parameters! ;-)
pdb_dir = oname.dirname
if pdb_dir:
compile_args = compile_args + ['/Fd%s\\' % (pdb_dir,)]
args = ['/nologo', '/c'] + compile_args + ['/Fo%s' % (oname,), str(cfile)]
> self._execute_c_compiler(cc, args, oname)
..\rpython\translator\platform\windows.py:290:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MsvcPlatform cc=cl.exe>, cc = 'cl.exe'
args = ['/nologo', '/c', '/MD', '/O2', '-DRPY_EXTERN=RPY_EXPORTED', '-DRPYTHON_LL2CTYPES', ...]
outname = local('d:\\systemtemp\\pytest\\usession-main-1281\\module_cache\\module_6.obj')
cwd = None
def _execute_c_compiler(self, cc, args, outname, cwd=None):
#log.execute(cc + ' ' + ' '.join(args))
# 'cc' can also contain some options for the C compiler;
# e.g. it can be "gcc -m32". We handle it by splitting on ' '.
cclist = cc.split()
cc = cclist[0]
args = cclist[1:] + args
returncode, stdout, stderr = _run_subprocess(cc, args, self.c_environ,
cwd)
> self._handle_error(returncode, stdout, stderr, outname)
..\rpython\translator\platform\__init__.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MsvcPlatform cc=cl.exe>, returncode = 3221225477, stdout = ''
stderr = ''
outname = local('d:\\systemtemp\\pytest\\usession-main-1281\\module_cache\\module_6.obj')
def _handle_error(self, returncode, stdout, stderr, outname):
if returncode != 0:
# Microsoft compilers write compilation errors to stdout
stderr = stdout + stderr
errorfile = outname.new(ext='errors')
errorfile.write(stderr, mode='wb')
if self.log_errors:
stderrlines = stderr.splitlines()
for line in stderrlines:
log.Error(line)
# ^^^ don't use ERROR, because it might actually be fine.
# Also, ERROR confuses lib-python/conftest.py.
> raise CompilationError(stdout, stderr)
E CompilationError: CompilationError(out="""
E """)
..\rpython\translator\platform\windows.py:319: CompilationError
_______ ERROR at setup of AppTestPosix.test_some_posix_basic_operation ________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00a44fb50>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_some_posix_basic_operation'>, '...lticall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_some_posix_basic_operation'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_some_posix_basic_operation'>, '...lticall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_some_posix_basic_operation'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_some_posix_basic_operation'>, '...lticall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_some_posix_basic_operation'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_some_posix_basic_operation'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00ab05f38>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._operation'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00991d1e0>
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 0x000002d00991d1e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._operation'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_some_posix_basic_operation'>, '__multicall__': <_MultiCall 0 results, 5 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_some_posix_basic_operation'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d009929da8>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d009929da8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d009929da8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d009929da8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00aa5a058>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00aa4e2e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00aa4e2e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00aa1cb80>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00aa1cb80>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00aa1cb80>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00aa1cb80>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00aa1cb80>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aa636a8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aa636a8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aa636a8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aa636a8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b543948>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b543948>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b543948>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00aa636a8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00aa636a8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a... 0x000002d00aa636a8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aa636a8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aa636a8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00b53c360>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00b5434b0>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b220>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b220>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b220>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
____________ ERROR at setup of AppTestPosix.test_stat_float_times _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00f230908>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_float_times'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_float_times'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_float_times'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_float_times'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_float_times'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_float_times'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_float_times'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d009dd89f8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...loat_times'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00c2d4260>
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 0x000002d00c2d4260>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...loat_times'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_float_times'>, '__multicall__': <_MultiCall 0 results, 5 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_stat_float_times'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00a75a170>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00a75a170>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00a75a170>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00a75a170>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d009541050>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00952e860>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00952e860>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0094eb360>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0094eb360>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0094eb360>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0094eb360>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d0094eb360>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0095800c8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0095800c8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0095800c8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0095800c8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a8621e0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a8621e0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a8621e0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d0095800c8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d0095800c8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009... 0x000002d0095800c8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0095800c8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0095800c8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d009ca03e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00a859d00>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a4c0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a4c0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a4c0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_______________ ERROR at setup of AppTestPosix.test_stat_result _______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c05eea8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_result'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_result'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_result'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_result'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_result'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_result'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_result'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00e9d0480>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...tat_result'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00abe88e0>
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 0x000002d00abe88e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...tat_result'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_result'>, '__multicall__': <_MultiCall 0 results, 5 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_stat_result'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00abecaa0>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00abecaa0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00abecaa0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00abecaa0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d009b61018>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009b802e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009b802e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e426410>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e426410>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e426410>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e426410>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00e426410>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009b66918>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009b66918>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009b66918>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009b66918>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009b383a0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009b383a0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009b383a0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d009b66918>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d009b66918>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009... 0x000002d009b66918>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009b66918>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009b66918>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d009ae0de0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d009b19ec0>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f00>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f00>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f00>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_______________ ERROR at setup of AppTestPosix.test_stat_lstat ________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00f231100>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_lstat'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_lstat'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_lstat'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_lstat'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_lstat'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_lstat'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_lstat'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00a6f39e8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...stat_lstat'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00f01b4e0>
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 0x000002d00f01b4e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...stat_lstat'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_lstat'>, '__multicall__': <_MultiCall 0 results, 5 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_stat_lstat'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00deac6b0>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00deac6b0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00deac6b0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00deac6b0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d009b92448>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00b2d5ae0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00b2d5ae0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00abd0448>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00abd0448>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00abd0448>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00abd0448>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00abd0448>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009ba4448>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009ba4448>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009ba4448>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009ba4448>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00bbb8330>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00bbb8330>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00bbb8330>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d009ba4448>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d009ba4448>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009... 0x000002d009ba4448>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009ba4448>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009ba4448>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00dfb25e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00bbcde50>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afc0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afc0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afc0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_stat_exception ______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00e1591f0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_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, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d008dde930>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00a34f660>
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 0x000002d00a34f660>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_stat_exception'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d0098c5f68>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0098c5f68>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0098c5f68>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d0098c5f68>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00b05f328>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00a7a40a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00a7a40a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a4ad478>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a4ad478>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a4ad478>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a4ad478>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00a4ad478>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d522480>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d522480>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d522480>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d522480>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ec2acd0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ec2acd0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ec2acd0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d522480>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d522480>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00d522480>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d522480>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d522480>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00a817360>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00ec2a838>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99ec0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99ec0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99ec0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_pickle __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00d638548>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pickle'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pickle'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pickle'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pickle'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pickle'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pickle'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pickle'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00986f010>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_pickle'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00ee64ce0>
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 0x000002d00ee64ce0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_pickle'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pickle'>, '__multicall__': <_MultiCall 0 results, 5 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_pickle'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00ee709c0>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ee709c0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ee709c0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ee709c0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00ee4e090>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00ee657a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00ee657a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ee94de8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ee94de8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ee94de8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ee94de8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00ee94de8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eeac758>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eeac758>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eeac758>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eeac758>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ecbd360>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ecbd360>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ecbd360>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00eeac758>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00eeac758>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00eeac758>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eeac758>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eeac758>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00efb5da0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00ecbcec8>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a200>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a200>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a200>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_open_exception ______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00e158db8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_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, 5 meths, kwargs={'item': <AppTestMethod 'test_open_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00a7c6e80>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d009db6f60>
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 0x000002d009db6f60>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_open_exception'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00ef3a950>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ef3a950>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ef3a950>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ef3a950>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00cc02800>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009db7960>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009db7960>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cc386e8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cc386e8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cc386e8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cc386e8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00cc386e8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cbfa8e0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cbfa8e0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cbfa8e0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cbfa8e0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b428de8>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b428de8>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b428de8>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cbfa8e0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cbfa8e0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c... 0x000002d00cbfa8e0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cbfa8e0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cbfa8e0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00c213de0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00b428950>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afa0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afa0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afa0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
___________ ERROR at setup of AppTestPosix.test_filename_exception ____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00ee991f0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_filename_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_filename_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_filename_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_filename_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_filename_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_filename_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, 5 meths, kwargs={'item': <AppTestMethod 'test_filename_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00efa9dd0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00a143860>
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 0x000002d00a143860>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_filename_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_filename_exception'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00ba23398>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ba23398>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ba23398>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ba23398>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00e294e20>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00a3792e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00a3792e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00df07520>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00df07520>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00df07520>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00df07520>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00df07520>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e3acf70>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e3acf70>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e3acf70>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e3acf70>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a0c3408>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a0c3408>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a0c3408>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e3acf70>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e3acf70>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00e3acf70>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e3acf70>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e3acf70>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00a578da0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00a0c2e58>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f60>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f60>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f60>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________ ERROR at setup of AppTestPosix.test_open_handles_NUL_chars __________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00bf6c908>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_handles_NUL_chars'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_handles_NUL_chars'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_handles_NUL_chars'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_handles_NUL_chars'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_handles_NUL_chars'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_handles_NUL_chars'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_handles_NUL_chars'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00c6c7218>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._NUL_chars'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00dd95aa0>
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 0x000002d00dd95aa0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._NUL_chars'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_handles_NUL_chars'>, '__multicall__': <_MultiCall 0 results, 5 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_open_handles_NUL_chars'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00dd3c800>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00dd3c800>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00dd3c800>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00dd3c800>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00ba56058>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00dd5c960>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00dd5c960>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ba4a790>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ba4a790>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ba4a790>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ba4a790>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00ba4a790>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ba1ccd0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ba1ccd0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ba1ccd0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ba1ccd0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e9f0aa0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e9f0aa0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e9f0aa0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00ba1ccd0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00ba1ccd0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b... 0x000002d00ba1ccd0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ba1ccd0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ba1ccd0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00ea11560>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00e5c2800>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f80>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f80>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99f80>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_chmod_exception _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00d638098>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chmod_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chmod_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chmod_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, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00a0347c8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00a3919a0>
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 0x000002d00a3919a0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_chmod_exception'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00de6a3d8>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00de6a3d8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00de6a3d8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00de6a3d8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00de30090>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00a2be0e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00a2be0e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00de47600>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00de47600>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00de47600>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00de47600>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00de47600>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b386758>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b386758>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b386758>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b386758>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e304090>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e304090>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e304090>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00b386758>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00b386758>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b... 0x000002d00b386758>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b386758>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b386758>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00abe9aa0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00e305248>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9aee0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9aee0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9aee0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_chown_exception _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00ba3b3d0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chown_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chown_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chown_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chown_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chown_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chown_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, 5 meths, kwargs={'item': <AppTestMethod 'test_chown_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00cda6e30>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00d653820>
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 0x000002d00d653820>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chown_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_chown_exception'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d0088b8480>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0088b8480>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0088b8480>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d0088b8480>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d009816138>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009aae9e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009aae9e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009514f38>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009514f38>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009514f38>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009514f38>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d009514f38>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009cc8bb8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009cc8bb8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009cc8bb8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009cc8bb8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a919130>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a919130>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a919130>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d009cc8bb8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d009cc8bb8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009... 0x000002d009cc8bb8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009cc8bb8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009cc8bb8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00f6f95a0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00a9186e8>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a140>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a140>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a140>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_utime_exception _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00bf6c980>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime_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, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00af41d80>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00d477e20>
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 0x000002d00d477e20>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_exception'>, '__multicall__': <_MultiCall 0 results, 5 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_utime_exception'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00d9c7788>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d9c7788>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d9c7788>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00d9c7788>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00cd738d8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00d4ac7a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00d4ac7a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cdb92b8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cdb92b8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cdb92b8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cdb92b8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00cdb92b8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cd82720>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cd82720>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cd82720>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cd82720>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00aea8170>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00aea8170>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00aea8170>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cd82720>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cd82720>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c... 0x000002d00cd82720>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cd82720>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cd82720>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00dfef460>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00ae57b40>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a320>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a320>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a320>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________ ERROR at setup of AppTestPosix.test_functions_raise_error __________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00f98bf88>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_functions_raise_error'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_functions_raise_error'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_functions_raise_error'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_functions_raise_error'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_functions_raise_error'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_functions_raise_error'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_functions_raise_error'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00c606fe8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...aise_error'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00bc92fa0>
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 0x000002d00bc92fa0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...aise_error'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_functions_raise_error'>, '__multicall__': <_MultiCall 0 results, 5 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_functions_raise_error'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00abd3d00>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00abd3d00>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00abd3d00>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00abd3d00>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d009f75408>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00bc937e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00bc937e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00bbc43d8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00bbc43d8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00bbc43d8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00bbc43d8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00bbc43d8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a482560>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a482560>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a482560>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a482560>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d61cf00>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d61cf00>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d61cf00>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00a482560>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00a482560>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a... 0x000002d00a482560>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a482560>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a482560>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00bcc0160>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00d61c950>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b2e0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b2e0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b2e0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_fdopen __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00bf6cf20>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00bc7d218>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00f3fd7e0>
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 0x000002d00f3fd7e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 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_fdopen'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00b9e97f8>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00b9e97f8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00b9e97f8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00b9e97f8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00cfde640>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f4847a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f4847a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b98e598>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b98e598>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b98e598>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b98e598>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00b98e598>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d02a1a8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d02a1a8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d02a1a8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d02a1a8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c472608>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c472608>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c472608>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d02a1a8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d02a1a8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00d02a1a8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d02a1a8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d02a1a8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00f54a5a0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00c471c58>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0c0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0c0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0c0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________ ERROR at setup of AppTestPosix.test_fdopen_hackedbuiltins __________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00f98b880>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_hackedbuiltins'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_hackedbuiltins'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_hackedbuiltins'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_hackedbuiltins'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_hackedbuiltins'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_hackedbuiltins'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_hackedbuiltins'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d0083d6548>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...edbuiltins'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00d1e9560>
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 0x000002d00d1e9560>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...edbuiltins'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_hackedbuiltins'>, '__multicall__': <_MultiCall 0 results, 5 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_fdopen_hackedbuiltins'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d009f6dc90>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d009f6dc90>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d009f6dc90>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d009f6dc90>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00cf8e2c0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00d1e9b60>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00d1e9b60>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cf80100>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cf80100>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cf80100>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cf80100>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00cf80100>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cfac988>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cfac988>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cfac988>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cfac988>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b618bf0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b618bf0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b618bf0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cfac988>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cfac988>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c... 0x000002d00cfac988>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cfac988>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cfac988>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00d224020>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00b618288>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a340>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a340>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a340>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
____________ ERROR at setup of AppTestPosix.test_fdopen_directory _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00aea0110>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_directory'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_directory'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_directory'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_directory'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_directory'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_directory'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_directory'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d009aceed0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._directory'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00a0714e0>
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 0x000002d00a0714e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._directory'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_directory'>, '__multicall__': <_MultiCall 0 results, 5 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_fdopen_directory'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00da8db08>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00da8db08>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00da8db08>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00da8db08>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00f24d5c8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00a084420>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00a084420>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00f0a3558>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00f0a3558>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00f0a3558>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00f0a3558>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00f0a3558>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d35af70>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d35af70>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d35af70>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d35af70>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e30b130>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e30b130>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e30b130>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d35af70>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d35af70>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00d35af70>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d35af70>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d35af70>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00a1425e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00e30abf0>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0a0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0a0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0a0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____ ERROR at setup of AppTestPosix.test_fdopen_keeps_fd_open_on_errors ______
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c05e728>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_keeps_fd_open_on_errors'...all__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_keeps_fd_open_on_errors'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_keeps_fd_open_on_errors'...all__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_keeps_fd_open_on_errors'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_keeps_fd_open_on_errors'...all__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen_keeps_fd_open_on_errors'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_keeps_fd_open_on_errors'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d009582638>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._on_errors'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00e05dde0>
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 0x000002d00e05dde0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._on_errors'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen_keeps_fd_open_on_errors'>, '__multicall__': <_MultiCall 0 results, 5 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_fdopen_keeps_fd_open_on_errors'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00ce74fa8>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ce74fa8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ce74fa8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ce74fa8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00b2454e8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e02a3a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e02a3a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b292c98>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b292c98>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b292c98>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b292c98>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00b292c98>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b251bb0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b251bb0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b251bb0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b251bb0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a6fb670>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a6fb670>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a6fb670>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00b251bb0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00b251bb0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b... 0x000002d00b251bb0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b251bb0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b251bb0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00ce96f60>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00a6fb130>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afe0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afe0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9afe0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_getcwd __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00cfd9da8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_getcwd'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getcwd'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_getcwd'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getcwd'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_getcwd'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getcwd'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_getcwd'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d009a1c160>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_getcwd'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00e8fb720>
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 0x000002d00e8fb720>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_getcwd'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_getcwd'>, '__multicall__': <_MultiCall 0 results, 5 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_getcwd'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00d299c20>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d299c20>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d299c20>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00d299c20>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00e318e90>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00ebf7520>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00ebf7520>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b3b1cc8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b3b1cc8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b3b1cc8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b3b1cc8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00b3b1cc8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc06058>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc06058>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc06058>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc06058>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a9623a0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a9623a0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a9623a0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00bc06058>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00bc06058>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b... 0x000002d00bc06058>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc06058>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc06058>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00ec6a2a0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00a94fda8>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a520>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a520>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a520>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_listdir _________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c494020>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_listdir'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_listdir'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_listdir'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00e1744a8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_listdir'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00e164460>
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 0x000002d00e164460>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_listdir'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir'>, '__multicall__': <_MultiCall 0 results, 5 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_listdir'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00e1606b0>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00e1606b0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00e1606b0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00e1606b0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00e198ad8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e1d1720>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e1d1720>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e496020>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e496020>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e496020>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e496020>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00e496020>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f3d91d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f3d91d8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f3d91d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f3d91d8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d6166b0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d6166b0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d6166b0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00f3d91d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00f3d91d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f... 0x000002d00f3d91d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f3d91d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f3d91d8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00f4d39e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00d616218>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b160>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b160>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b160>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_listdir_unicode _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d0095ff6a0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_listdir_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_listdir_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_listdir_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, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00cba7da8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...ir_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00e11dc20>
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 0x000002d00e11dc20>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...ir_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_listdir_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_listdir_unicode'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d009692410>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d009692410>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d009692410>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d009692410>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00c2f4608>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00d43e5a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00d43e5a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c3173d0>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c3173d0>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c3173d0>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c3173d0>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00c3173d0>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e124800>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e124800>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e124800>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e124800>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f71be88>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f71be88>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f71be88>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e124800>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e124800>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00e124800>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e124800>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e124800>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00e75e9e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00f722e58>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b1a0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b1a0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b1a0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_access __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00bb9dc40>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_access'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_access'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_access'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_access'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_access'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_access'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_access'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00b80a638>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_access'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d009d6c520>
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 0x000002d009d6c520>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_access'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_access'>, '__multicall__': <_MultiCall 0 results, 5 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_access'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00e586cd0>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00e586cd0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00e586cd0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00e586cd0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00ee89bb0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009d6cba0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009d6cba0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b636e58>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b636e58>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b636e58>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b636e58>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00b636e58>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b2174b0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b2174b0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b2174b0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b2174b0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b84e410>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b84e410>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b84e410>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00b2174b0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00b2174b0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b... 0x000002d00b2174b0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b2174b0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b2174b0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d009f9f2e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00b857ec0>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a3a0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a3a0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a3a0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_unlink __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c495088>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_unlink'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_unlink'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_unlink'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_unlink'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_unlink'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_unlink'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_unlink'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00cc21380>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_unlink'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00f9c13a0>
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 0x000002d00f9c13a0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_unlink'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_unlink'>, '__multicall__': <_MultiCall 0 results, 5 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_unlink'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00d489ad0>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d489ad0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d489ad0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00d489ad0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00c156758>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f9c19e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f9c19e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c1b43a0>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c1b43a0>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c1b43a0>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c1b43a0>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00c1b43a0>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f22edb0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f22edb0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f22edb0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f22edb0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d1f9130>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d1f9130>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d1f9130>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00f22edb0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00f22edb0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f... 0x000002d00f22edb0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f22edb0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f22edb0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00e4cc420>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00d1f8c60>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a080>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a080>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a080>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________________ ERROR at setup of AppTestPosix.test_times __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00bb9d268>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_times'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_times'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_times'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_times'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_times'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_times'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_times'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00f40f3f8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_times'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00ded4660>
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 0x000002d00ded4660>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_times'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_times'>, '__multicall__': <_MultiCall 0 results, 5 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_times'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00bfa6f38>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00bfa6f38>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00bfa6f38>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00bfa6f38>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00a96da98>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00ded59a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00ded59a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e08dec0>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e08dec0>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e08dec0>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e08dec0>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00e08dec0>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a962f38>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a962f38>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a962f38>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a962f38>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d2e56e0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d2e56e0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d2e56e0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00a962f38>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00a962f38>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a... 0x000002d00a962f38>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a962f38>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a962f38>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00df11ea0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00d2e5248>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b000>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b000>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b000>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
________________ ERROR at setup of AppTestPosix.test_strerror _________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00cef89f8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_strerror'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_strerror'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_strerror'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_strerror'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_strerror'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_strerror'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_strerror'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d009cb91f0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...t_strerror'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00f43b720>
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 0x000002d00f43b720>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...t_strerror'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_strerror'>, '__multicall__': <_MultiCall 0 results, 5 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_strerror'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d01013ba98>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d01013ba98>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d01013ba98>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d01013ba98>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d0100dad40>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f43bce0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f43bce0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0101345d0>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0101345d0>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0101345d0>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d0101345d0>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d0101345d0>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e00b280>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e00b280>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e00b280>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e00b280>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b5d5be8>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b5d5be8>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b5d5be8>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e00b280>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e00b280>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00e00b280>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e00b280>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e00b280>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00b5b20e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00b5d5750>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b240>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b240>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b240>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________________ ERROR at setup of AppTestPosix.test_popen __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00bb9cea8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00de240c0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00bdd8320>
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 0x000002d00bdd8320>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d0101c9be8>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0101c9be8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0101c9be8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d0101c9be8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d0100d58a0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00bdd8960>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00bdd8960>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b5db440>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b5db440>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b5db440>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b5db440>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00b5db440>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01013ec60>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01013ec60>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01013ec60>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01013ec60>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d8430c0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d8430c0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d8430c0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d010...trategy object at 0x000002d01013ec60>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d010...trategy object at 0x000002d01013ec60>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d010... 0x000002d01013ec60>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01013ec60>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01013ec60>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00bdbf120>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00d842e20>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a360>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a360>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a360>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_______________ ERROR at setup of AppTestPosix.test_popen_with ________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d01010f3d0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 5 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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 5 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, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d009569e70>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...popen_with'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00b41f920>
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 0x000002d00b41f920>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...popen_with'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 5 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'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00ef9a800>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ef9a800>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ef9a800>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ef9a800>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00e764b48>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00b7ba9e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00b7ba9e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cf86f38>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cf86f38>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cf86f38>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00cf86f38>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00cf86f38>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc4b440>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc4b440>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc4b440>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc4b440>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a1aecd0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a1aecd0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a1aecd0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00dc4b440>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00dc4b440>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00dc4b440>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc4b440>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc4b440>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00b807d20>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00a1ae6e8>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0e0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0e0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b0e0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_popen_child_fds _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c7e1cb8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 5 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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 5 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, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00ea36188>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._child_fds'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00f00a420>
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 0x000002d00f00a420>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._child_fds'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 5 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'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00aa810c0>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00aa810c0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00aa810c0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00aa810c0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00aad8de8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f00ace0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f00ace0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00aaaee58>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00aaaee58>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00aaaee58>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00aaaee58>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00aaaee58>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e335c20>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e335c20>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e335c20>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e335c20>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ebdaf38>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ebdaf38>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00ebdaf38>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e335c20>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e335c20>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00e335c20>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e335c20>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e335c20>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00a0f37e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00ebdac98>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b020>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b020>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b020>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
____________ ERROR at setup of AppTestPosix.test__getfullpathname _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c16db50>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test__getfullpathname'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test__getfullpathname'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test__getfullpathname'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test__getfullpathname'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test__getfullpathname'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test__getfullpathname'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test__getfullpathname'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00a9af8a8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...llpathname'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d009fd6ce0>
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 0x000002d009fd6ce0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...llpathname'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test__getfullpathname'>, '__multicall__': <_MultiCall 0 results, 5 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__getfullpathname'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00aed1590>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00aed1590>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00aed1590>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00aed1590>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00a1c57c0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009fd7360>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009fd7360>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b871830>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b871830>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b871830>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00b871830>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00b871830>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc83408>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc83408>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc83408>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc83408>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0097096a8>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0097096a8>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0097096a8>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cc83408>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cc83408>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c... 0x000002d00cc83408>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc83408>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc83408>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d009fb0260>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d0097090c0>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a3e0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a3e0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a3e0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________________ ERROR at setup of AppTestPosix.test_utime __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c7e1f88>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00c0e48e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_utime'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00bb5ba20>
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 0x000002d00bb5ba20>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_utime'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime'>, '__multicall__': <_MultiCall 0 results, 5 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_utime'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00bb4f558>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00bb4f558>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00bb4f558>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00bb4f558>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00d33bbb0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00d350360>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00d350360>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d2fb2b8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d2fb2b8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d2fb2b8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d2fb2b8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00d2fb2b8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc092b8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc092b8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc092b8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc092b8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f5204f0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f5204f0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f5204f0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00dc092b8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00dc092b8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00dc092b8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc092b8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00dc092b8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00dbe4420>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00f583b40>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a160>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a160>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a160>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
______________ ERROR at setup of AppTestPosix.test_utime_raises _______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00ebabbc8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_raises'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_raises'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_raises'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_utime_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, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_raises'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00bc7de70>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...ime_raises'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00f712060>
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 0x000002d00f712060>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...ime_raises'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_utime_raises'>, '__multicall__': <_MultiCall 0 results, 5 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_utime_raises'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00b6bc480>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00b6bc480>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00b6bc480>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00b6bc480>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00dc09be8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f7125a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00f7125a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e8c89f8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e8c89f8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e8c89f8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e8c89f8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00e8c89f8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f589328>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f589328>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f589328>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f589328>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b8ff590>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b8ff590>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00b8ff590>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00f589328>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00f589328>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f... 0x000002d00f589328>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f589328>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f589328>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00ea39220>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00b8ff0f8>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b040>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b040>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b040>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________________ ERROR at setup of AppTestPosix.test_fsync __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c7e1178>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fsync'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fsync'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fsync'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fsync'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fsync'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fsync'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fsync'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00cba6bd8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_fsync'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d009aaea20>
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 0x000002d009aaea20>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_fsync'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fsync'>, '__multicall__': <_MultiCall 0 results, 5 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_fsync'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00d8c1c58>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d8c1c58>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d8c1c58>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00d8c1c58>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00ddf9868>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009aaf2e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009aaf2e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00de13910>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00de13910>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00de13910>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00de13910>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00de13910>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc04250>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc04250>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc04250>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc04250>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009b66f00>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009b66f00>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009b66f00>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00bc04250>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00bc04250>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b... 0x000002d00bc04250>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc04250>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00bc04250>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00f6f8020>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d009b43e50>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fc0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fc0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fc0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
________________ ERROR at setup of AppTestPosix.test_largefile ________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00a3c06b0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_largefile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_largefile'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_largefile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_largefile'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_largefile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_largefile'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_largefile'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00b380f70>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._largefile'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d0100b9de0>
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 0x000002d0100b9de0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._largefile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_largefile'>, '__multicall__': <_MultiCall 0 results, 5 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_largefile'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00efbe8a8>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00efbe8a8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00efbe8a8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00efbe8a8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00a5a1c90>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e4ccce0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e4ccce0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a5b70c0>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a5b70c0>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a5b70c0>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a5b70c0>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00a5b70c0>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e9421e0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e9421e0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e9421e0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e9421e0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a6b0a30>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a6b0a30>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a6b0a30>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e9421e0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e9421e0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00e9421e0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e9421e0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e9421e0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00d5d17e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00a6b0598>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fa0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fa0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fa0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
______________ ERROR at setup of AppTestPosix.test_write_buffer _______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00c7e03e0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_buffer'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_buffer'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_buffer'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_buffer'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_buffer'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_buffer'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_buffer'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00efa8958>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...ite_buffer'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00df11a60>
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 0x000002d00df11a60>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...ite_buffer'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_buffer'>, '__multicall__': <_MultiCall 0 results, 5 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_buffer'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00ea0ab10>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ea0ab10>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ea0ab10>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ea0ab10>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00ad43910>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00df340e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00df340e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00affa678>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00affa678>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00affa678>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00affa678>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00affa678>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c9be020>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c9be020>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c9be020>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c9be020>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a742950>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a742950>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00a742950>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00c9be020>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00c9be020>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c... 0x000002d00c9be020>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c9be020>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c9be020>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00df5e560>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00a752480>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9ae80>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9ae80>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9ae80>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
______________ ERROR at setup of AppTestPosix.test_write_unicode ______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00a5adcb8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_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, 5 meths, kwargs={'item': <AppTestMethod 'test_write_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d009ace570>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...te_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00c568c60>
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 0x000002d00c568c60>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...te_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_write_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_unicode'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00c030480>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00c030480>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00c030480>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00c030480>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00d17abf0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00c569160>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00c569160>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d16fa60>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d16fa60>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d16fa60>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d16fa60>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00d16fa60>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d1b72b8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d1b72b8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d1b72b8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d1b72b8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00eb15b08>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00eb15b08>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00eb15b08>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d1b72b8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d1b72b8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00d1b72b8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d1b72b8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d1b72b8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00c5cd6e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00eb15670>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b060>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b060>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b060>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_______________ ERROR at setup of AppTestPosix.test_closerange ________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00d59bda8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_closerange'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_closerange'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_closerange'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_closerange'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_closerange'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_closerange'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_closerange'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00ae167a0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...closerange'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00abe9de0>
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 0x000002d00abe9de0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...closerange'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_closerange'>, '__multicall__': <_MultiCall 0 results, 5 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_closerange'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00d1fe3d8>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d1fe3d8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d1fe3d8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00d1fe3d8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00e1df0f8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e3ea4e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e3ea4e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e96ae20>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e96ae20>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e96ae20>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e96ae20>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00e96ae20>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd9830>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd9830>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd9830>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd9830>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00cf533d0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00cf533d0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00cf533d0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00ecd9830>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00ecd9830>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00ecd9830>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd9830>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd9830>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00e42d220>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00cf52f38>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99d80>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99d80>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99d80>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________________ ERROR at setup of AppTestPosix.test_chmod __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d0093da200>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chmod'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chmod'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_chmod'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00ae2a840>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_chmod'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d0093be0a0>
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 0x000002d0093be0a0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_chmod'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_chmod'>, '__multicall__': <_MultiCall 0 results, 5 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_chmod'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00ade7f30>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ade7f30>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ade7f30>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ade7f30>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00e45a058>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00add2aa0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00add2aa0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00942c058>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00942c058>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00942c058>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00942c058>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00942c058>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d2b2bf0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d2b2bf0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d2b2bf0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d2b2bf0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f057830>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f057830>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00f057830>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d2b2bf0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d2b2bf0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00d2b2bf0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d2b2bf0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d2b2bf0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d0108fb220>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00f057210>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b1c0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b1c0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b1c0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_tmpfile _________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00a5ad2e0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpfile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpfile'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpfile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpfile'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpfile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpfile'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpfile'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00a7e37b8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_tmpfile'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00e9814e0>
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 0x000002d00e9814e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_tmpfile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpfile'>, '__multicall__': <_MultiCall 0 results, 5 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_tmpfile'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00d96afe0>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d96afe0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d96afe0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00d96afe0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00f3d38a0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e981d60>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e981d60>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00f3e7d70>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00f3e7d70>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00f3e7d70>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00f3e7d70>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00f3e7d70>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d76c5d0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d76c5d0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d76c5d0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d76c5d0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e4dfde0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e4dfde0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e4dfde0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d76c5d0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00d76c5d0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00d76c5d0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d76c5d0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d76c5d0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00939e760>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00e4df478>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b2a0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b2a0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b2a0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_tmpnam __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d0110062f0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpnam'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpnam'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpnam'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d01192ed90>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_tmpnam'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00c8fcaa0>
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 0x000002d00c8fcaa0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_tmpnam'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam'>, '__multicall__': <_MultiCall 0 results, 5 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_tmpnam'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00b1bea30>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00b1bea30>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00b1bea30>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00b1bea30>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d009423398>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00c8fd060>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00c8fd060>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009ff78d8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009ff78d8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009ff78d8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009ff78d8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d009ff78d8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eec2a68>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eec2a68>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eec2a68>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eec2a68>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d010801248>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d010801248>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d010801248>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00eec2a68>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00eec2a68>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00eec2a68>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eec2a68>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00eec2a68>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00eb879e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d010800d78>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fe0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fe0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b99fe0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_tempnam _________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00a5ac6b0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tempnam'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tempnam'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tempnam'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tempnam'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tempnam'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tempnam'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tempnam'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00a98ac28>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_tempnam'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00efb4d60>
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 0x000002d00efb4d60>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_tempnam'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tempnam'>, '__multicall__': <_MultiCall 0 results, 5 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_tempnam'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00eebde50>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00eebde50>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00eebde50>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00eebde50>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00e0827c8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00efb5560>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00efb5560>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d507ec0>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d507ec0>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d507ec0>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d507ec0>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00d507ec0>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f77cb80>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f77cb80>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f77cb80>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f77cb80>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00af65e50>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00af65e50>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00af65e50>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00f77cb80>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00f77cb80>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f... 0x000002d00f77cb80>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f77cb80>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f77cb80>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00f7120a0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00af654e8>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a1c0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a1c0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a1c0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_tmpnam_warning ______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d010bc4188>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam_warning'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpnam_warning'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam_warning'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpnam_warning'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam_warning'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tmpnam_warning'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam_warning'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d01202d5d8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...am_warning'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00c3ca020>
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 0x000002d00c3ca020>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...am_warning'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_tmpnam_warning'>, '__multicall__': <_MultiCall 0 results, 5 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_tmpnam_warning'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d011407750>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d011407750>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d011407750>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d011407750>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00eec9da8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d011f6d2a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d011f6d2a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00daaefe0>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00daaefe0>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00daaefe0>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00daaefe0>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00daaefe0>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ffd83d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ffd83d8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ffd83d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ffd83d8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c537a28>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c537a28>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c537a28>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00ffd83d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00ffd83d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f... 0x000002d00ffd83d8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ffd83d8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ffd83d8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d0118c98e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d00c537558>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b400>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b400>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b400>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
________________ ERROR at setup of AppTestPosix.test_has_kill _________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00a5ad088>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_has_kill'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_has_kill'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_has_kill'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_has_kill'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_has_kill'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_has_kill'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_has_kill'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00ae16750>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...t_has_kill'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00bdbec60>
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 0x000002d00bdbec60>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...t_has_kill'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_has_kill'>, '__multicall__': <_MultiCall 0 results, 5 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_has_kill'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00a415088>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00a415088>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00a415088>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00a415088>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d010056528>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00bdbf520>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00bdbf520>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c0267c8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c0267c8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c0267c8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c0267c8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00c0267c8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a9ad600>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a9ad600>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a9ad600>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a9ad600>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011274528>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011274528>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011274528>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00a9ad600>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00a9ad600>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a... 0x000002d00a9ad600>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a9ad600>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a9ad600>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00ba6a0a0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d011255788>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9af00>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9af00>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9af00>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_______________ ERROR at setup of AppTestPosix.test_pipe_flush ________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d0120d6020>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pipe_flush'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pipe_flush'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pipe_flush'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pipe_flush'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pipe_flush'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pipe_flush'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pipe_flush'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d0120ce1b0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...pipe_flush'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d0120d4020>
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 0x000002d0120d4020>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...pipe_flush'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_pipe_flush'>, '__multicall__': <_MultiCall 0 results, 5 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_pipe_flush'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d0120cc058>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0120cc058>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0120cc058>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d0120cc058>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d012123440>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0120be660>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0120be660>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012122368>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012122368>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012122368>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012122368>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d012122368>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc34218>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc34218>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc34218>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc34218>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011406ec8>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011406ec8>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011406ec8>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cc34218>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c...trategy object at 0x000002d00cc34218>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00c... 0x000002d00cc34218>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc34218>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00cc34218>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d011fdc760>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d011406a30>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a2c0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a2c0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a2c0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_urandom _________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00a3c09f8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_urandom'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_urandom'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_urandom'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_urandom'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_urandom'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_urandom'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_urandom'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d008fe02f0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_urandom'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00ba6aca0>
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 0x000002d00ba6aca0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_urandom'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_urandom'>, '__multicall__': <_MultiCall 0 results, 5 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_urandom'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d00a6a4170>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00a6a4170>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00a6a4170>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00a6a4170>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00b4e10f8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00ba6b320>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00ba6b320>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a9ce410>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a9ce410>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a9ce410>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a9ce410>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00a9ce410>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ee23f30>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ee23f30>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ee23f30>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ee23f30>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0113ce2f8>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0113ce2f8>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d0113ce2f8>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00ee23f30>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00ee23f30>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00ee23f30>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ee23f30>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ee23f30>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00967fee0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d0113bdde0>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a480>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a480>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9a480>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
________________ ERROR at setup of AppTestPosix.test_startfile ________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d010a66020>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_startfile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_startfile'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_startfile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_startfile'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_startfile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_startfile'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_startfile'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d010a70200>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._startfile'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d010a68020>
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 0x000002d010a68020>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._startfile'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_startfile'>, '__multicall__': <_MultiCall 0 results, 5 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_startfile'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d010a6c058>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d010a6c058>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d010a6c058>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d010a6c058>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d011cce758>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0109e8020>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0109e8020>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d010a38410>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d010a38410>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d010a38410>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d010a38410>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d010a38410>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011cbce20>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011cbce20>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011cbce20>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011cbce20>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d010c571d8>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d010c571d8>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d010c571d8>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011...trategy object at 0x000002d011cbce20>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011...trategy object at 0x000002d011cbce20>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011... 0x000002d011cbce20>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011cbce20>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011cbce20>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d010dff5e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d010c56d08>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b440>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b440>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b440>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_rename __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00a3c0368>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_rename'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_rename'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_rename'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_rename'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_rename'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_rename'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_rename'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00efa8598>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_rename'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00e07b760>
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 0x000002d00e07b760>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_rename'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_rename'>, '__multicall__': <_MultiCall 0 results, 5 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_rename'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['binascii', 'posix', 'signal', 'struct', 'time', '_rawffi', ...]}
config = <rpython.config.config.Config object at 0x000002d010649cc8>
key = (((False, True, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d010649cc8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d010649cc8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d010649cc8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00a6e81e0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (14 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e07bde0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00e07bde0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ae45600>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ae45600>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ae45600>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00ae45600>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00ae45600>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd4d78>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd4d78>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd4d78>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd4d78>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011331a60>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011331a60>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011331a60>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00ecd4d78>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00ecd4d78>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00ecd4d78>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd4d78>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00ecd4d78>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
> lock.acquire_lock()
module\imp\importing.py:323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.imp.importing.ImportRLock instance at 0x000002d00bdf15e0>
def acquire_lock(self):
# this function runs with the GIL acquired so there is no race
# condition in the creation of the lock
if self.lock is None:
try:
self.lock = self.space.allocate_lock()
except CannotHaveLock:
return
me = self.space.getexecutioncontext() # used as thread ident
if self.lockowner is me:
pass # already acquired by the current thread
else:
> self.lock.acquire(True)
module\imp\importing.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rthread.Lock object at 0x000002d0113163a0>, flag = True
def acquire(self, flag):
if flag:
> res = c_thread_acquirelock(self._lock, 1)
..\rpython\rlib\rthread.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b3c0>>, 1)
real_args = (<* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b3c0>>, 1L)
to_free = (), i = 1
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* <C object struct RPyOpaque_ThreadLock (opaque) at 0x2d004b9b3c0>>
a1 = 1L
def call_external_function(a0, a1):
> rgil.release()
<32-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
______________ ERROR at setup of AppTestEnvironment.test_environ ______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d012316020>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_environ'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_environ'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_environ'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d0123101d8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_environ'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d012314020>
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 0x000002d012314020>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...st_environ'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ'>, '__multicall__': <_MultiCall 0 results, 5 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_environ'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True}
config = <rpython.config.config.Config object at 0x000002d012306138>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d012306138>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d012306138>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d012306138>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d012399980>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d011630020>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d011630020>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012394020>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012394020>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012394020>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012394020>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d012394020>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0123a9600>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0123a9600>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0123a9600>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0123a9600>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011d26138>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011d26138>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011d26138>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d012...trategy object at 0x000002d0123a9600>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d012...trategy object at 0x000002d0123a9600>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d012... 0x000002d0123a9600>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0123a9600>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0123a9600>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________ ERROR at setup of AppTestEnvironment.test_environ_nonascii __________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d0120d7808>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ_nonascii'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_environ_nonascii'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ_nonascii'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_environ_nonascii'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ_nonascii'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_environ_nonascii'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ_nonascii'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00aef02c8>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...n_nonascii'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00c328260>
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 0x000002d00c328260>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...n_nonascii'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_environ_nonascii'>, '__multicall__': <_MultiCall 0 results, 5 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_environ_nonascii'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True}
config = <rpython.config.config.Config object at 0x000002d00ff21718>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ff21718>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ff21718>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ff21718>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d0097aa790>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00c3288e0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00c3288e0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009769c90>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009769c90>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009769c90>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d009769c90>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d009769c90>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b04e218>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b04e218>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b04e218>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b04e218>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e066560>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e066560>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00e066560>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00b04e218>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b...trategy object at 0x000002d00b04e218>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b... 0x000002d00b04e218>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b04e218>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00b04e218>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
________ ERROR at setup of AppTestEnvironment.test_putenv_invalid_name ________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d010bc4728>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_putenv_invalid_name'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_putenv_invalid_name'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_putenv_invalid_name'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_putenv_invalid_name'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_putenv_invalid_name'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_putenv_invalid_name'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_putenv_invalid_name'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00e732c00>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...valid_name'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00b394c60>
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 0x000002d00b394c60>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...valid_name'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_putenv_invalid_name'>, '__multicall__': <_MultiCall 0 results, 5 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_putenv_invalid_name'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True}
config = <rpython.config.config.Config object at 0x000002d00df78288>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00df78288>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00df78288>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00df78288>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00a752448>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00b3c2060>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00b3c2060>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a743600>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a743600>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a743600>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00a743600>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00a743600>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e0d6480>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e0d6480>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e0d6480>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e0d6480>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00cbbc790>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00cbbc790>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00cbbc790>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e0d6480>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e...trategy object at 0x000002d00e0d6480>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e... 0x000002d00e0d6480>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e0d6480>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00e0d6480>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
___________ ERROR at setup of AppTestPosixUnicode.test_stat_unicode ___________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d012316908>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_stat_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, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d010dcfd30>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...at_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d0122d0be0>
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 0x000002d0122d0be0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...at_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_stat_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_stat_unicode'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True}
config = <rpython.config.config.Config object at 0x000002d01168ee20>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d01168ee20>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d01168ee20>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d01168ee20>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d010aa9360>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0122d11a0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0122d11a0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d010aa8ad8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d010aa8ad8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d010aa8ad8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d010aa8ad8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d010aa8ad8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009796c98>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009796c98>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009796c98>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009796c98>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c0c5ef8>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c0c5ef8>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c0c5ef8>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d009796c98>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009...trategy object at 0x000002d009796c98>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009... 0x000002d009796c98>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009796c98>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d009796c98>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
___________ ERROR at setup of AppTestPosixUnicode.test_open_unicode ___________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d0120d6890>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open_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, 5 meths, kwargs={'item': <AppTestMethod 'test_open_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00af30430>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...en_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00c328260>
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 0x000002d00c328260>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...en_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_open_unicode'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True}
config = <rpython.config.config.Config object at 0x000002d00d742db0>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d742db0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00d742db0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00d742db0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00fe232f0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00c328ce0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00c328ce0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00fe812b8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00fe812b8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00fe812b8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00fe812b8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00fe812b8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00fe3ed78>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00fe3ed78>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00fe3ed78>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00fe3ed78>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011230d78>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011230d78>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d011230d78>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00fe3ed78>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f...trategy object at 0x000002d00fe3ed78>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00f... 0x000002d00fe3ed78>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00fe3ed78>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00fe3ed78>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________ ERROR at setup of AppTestPosixUnicode.test_remove_unicode __________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d012316b60>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_remove_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_remove_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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_remove_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_remove_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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_remove_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_remove_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, 5 meths, kwargs={'item': <AppTestMethod 'test_remove_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00e39b2e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...ve_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00eb20b20>
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 0x000002d00eb20b20>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...ve_unicode'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_remove_unicode'>, '__multicall__': <_MultiCall 0 results, 5 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_remove_unicode'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True}
config = <rpython.config.config.Config object at 0x000002d00b852a30>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00b852a30>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00b852a30>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00b852a30>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00cd837c0>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00eb21060>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00eb21060>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d9c7248>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d9c7248>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d9c7248>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d9c7248>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00d9c7248>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeaefe0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeaefe0>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeaefe0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeaefe0>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009c6b328>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009c6b328>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009c6b328>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00aeaefe0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00aeaefe0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a... 0x000002d00aeaefe0>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeaefe0>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeaefe0>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestUnicodeFilename.test_open ______________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00b1744d0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_open'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00e80e868>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...'test_open'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d011629560>
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 0x000002d011629560>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...'test_open'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_open'>, '__multicall__': <_MultiCall 0 results, 5 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_open'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True}
config = <rpython.config.config.Config object at 0x000002d00edd7718>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00edd7718>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00edd7718>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00edd7718>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d011baa4b8>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d011629ae0>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d011629ae0>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d011bb9948>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d011bb9948>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d011bb9948>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d011bb9948>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d011bb9948>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011bd1ef8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011bd1ef8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011bd1ef8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011bd1ef8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d131d00>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d131d00>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d131d00>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011...trategy object at 0x000002d011bd1ef8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011...trategy object at 0x000002d011bd1ef8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011... 0x000002d011bd1ef8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011bd1ef8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d011bd1ef8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of TestPexpect.test_ttyname __________________
item = <Function 'test_ttyname'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tool\pytest\objspace.py:25: in gettestobjspace
space = maketestobjspace(config)
tool\pytest\objspace.py:35: in maketestobjspace
space = make_objspace(config)
tool\option.py:33: in make_objspace
return StdObjSpace(config)
interpreter\baseobjspace.py:467: in __init__
self.initialize()
objspace\std\objspace.py:118: in initialize
self.setup_builtin_modules()
interpreter\baseobjspace.py:713: in setup_builtin_modules
mod.setup_after_space_initialization()
module\_warnings\moduledef.py:17: in setup_after_space_initialization
state = self.space.fromcache(State)
..\rpython\rlib\cache.py:51: in getorbuild
result = self._build(key)
interpreter\baseobjspace.py:402: in _build
return callable(self.space)
module\_warnings\interp_warnings.py:13: in __init__
self.init_filters(space)
module\_warnings\interp_warnings.py:20: in init_filters
if (not space.sys.get_flag('py3k_warning') and
module\sys\moduledef.py:180: in get_flag
return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
interpreter\mixedmodule.py:81: in get
w_value = self.getdictvalue(space, name)
module\sys\moduledef.py:145: in getdictvalue
value = MixedModule.getdictvalue(self, space, attr)
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:231: in afileloader
return app.wget(space, attrname)
interpreter\gateway.py:1211: in wget
w_globals = self.getwdict(space)
interpreter\gateway.py:1204: in getwdict
return space.fromcache(ApplevelCache).getorbuild(self)
..\rpython\rlib\cache.py:51: in getorbuild
result = self._build(key)
interpreter\baseobjspace.py:411: in _build
return self.build(key)
interpreter\gateway.py:1255: in build
return build_applevel_dict(app, self.space)
interpreter\gateway.py:1266: in build_applevel_dict
filename=self.filename)
interpreter\baseobjspace.py:1403: in exec_
return statement.exec_code(self, w_globals, w_locals)
interpreter\eval.py:33: in exec_code
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:64: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:322: in dispatch_bytecode
self.IMPORT_NAME(oparg, next_instr)
interpreter\pyopcode.py:1065: in IMPORT_NAME
w_locals, w_fromlist)
interpreter\baseobjspace.py:1210: in call_function
return w_func.funccall(*args_w)
interpreter\function.py:124: in funccall
return self.call_args(Arguments(self.space, list(args_w)))
interpreter\function.py:68: in call_args
w_res = self.getcode().funcrun(self, args)
interpreter\gateway.py:781: in funcrun
return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:795: in funcrun_obj
self.handle_exception(space, e)
interpreter\gateway.py:819: in handle_exception
raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:789: in funcrun_obj
w_result = activation._run(space, scope_w)
module\imp\importing.py:293: in importhook
w_fromlist, tentative=True)
module\imp\importing.py:317: in absolute_import
w_fromlist, tentative)
module\imp\importing.py:326: in absolute_import_with_lock
w_fromlist, tentative)
module\imp\importing.py:404: in _absolute_import
tentative=tentative)
module\imp\importing.py:703: in load_part
space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:593: in find_module
stream = streamio.open_file_as_stream(filename, filemode)
..\rpython\rlib\streamio.py:88: in open_file_as_stream
stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:123: in open_path_helper
fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\rposix.py:468: in open
fd = c_wopen(buf, flags, mode)
..\rpython\rtyper\lltypesystem\rffi.py:321: in wrapper
res = call_external_function(*real_args)
..\rpython\rlib\rgil.py:167: in release
_emulated_gil_holder.release()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_____________ ERROR at setup of AppTestPosix.test_posix_is_pypy_s _____________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d00f9e7b50>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_posix_is_pypy_s'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_posix_is_pypy_s'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_posix_is_pypy_s'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00e5a17e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d009d9d520>
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 0x000002d009d9d520>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_posix_is_pypy_s'>, '__multicall__': <_MultiCall 0 results, 5 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_posix_is_pypy_s'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['posix', 'time']}
config = <rpython.config.config.Config object at 0x000002d0107df360>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0107df360>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d0107df360>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d0107df360>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00b540330>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009dace20>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d009dace20>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e3bd018>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e3bd018>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e3bd018>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00e3bd018>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00e3bd018>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00df05670>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00df05670>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00df05670>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00df05670>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d7ad788>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d7ad788>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00d7ad788>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00df05670>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d...trategy object at 0x000002d00df05670>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00d... 0x000002d00df05670>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00df05670>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00df05670>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
_________________ ERROR at setup of AppTestPosix.test_fdopen __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d0120118f8>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen'>}
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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen'>}
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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_fdopen'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
..\_pytest\vendored_packages\pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d0098b85c0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00bb06420>
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 0x000002d00bb06420>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...est_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_fdopen'>, '__multicall__': <_MultiCall 0 results, 5 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_fdopen'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['posix', 'time']}
config = <rpython.config.config.Config object at 0x000002d00ab506b0>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ab506b0>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00ab506b0>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00ab506b0>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00d14b210>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00bb06a60>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d00bb06a60>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d14a7c8>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d14a7c8>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d14a7c8>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00d14a7c8>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00d14a7c8>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01092cc98>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01092cc98>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01092cc98>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01092cc98>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c70ab10>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c70ab10>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d00c70ab10>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d010...trategy object at 0x000002d01092cc98>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d010...trategy object at 0x000002d01092cc98>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d010... 0x000002d01092cc98>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01092cc98>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d01092cc98>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__________________ ERROR at setup of AppTestPosix.test_popen __________________
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d012d8c4d0>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d010cec700>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d005f0cde0>
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 0x000002d005f0cde0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 5 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'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['posix', 'time']}
config = <rpython.config.config.Config object at 0x000002d00c9bf4e8>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00c9bf4e8>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00c9bf4e8>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00c9bf4e8>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00c7e3280>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0058bec20>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d0058bec20>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c7acd08>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c7acd08>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c7acd08>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d00c7acd08>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d00c7acd08>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeb8678>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeb8678>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeb8678>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeb8678>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009fa2410>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009fa2410>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d009fa2410>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00aeb8678>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a...trategy object at 0x000002d00aeb8678>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00a... 0x000002d00aeb8678>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeb8678>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d00aeb8678>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
__ ERROR at setup of AppTestPosix.test_popen_and_rebind_file_in___builtin__ ___
self = <CallInfo when='setup' exception: assert 0 == 2404
+ where 0 = 0
+ where 0 = <rpython.rlib.rgil.EmulatedGilHolde...der instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident>
func = <function <lambda> at 0x000002d0123f4020>, when = 'setup'
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_setup'>
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 5 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 0x000002d004751638>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 5 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_setup'>
methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d0060b33a0>, <_pytest.vendored_packages.pluggy.HookImp...y.HookImpl instance at 0x000002d004c187a0>, <_pytest.vendored_packages.pluggy.HookImpl instance at 0x000002d004c187e0>]
kwargs = {'__multicall__': <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 5 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, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>, '__multicall__': <_MultiCall 0 results, 5 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_setup at 0x000002d00fcea2f0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._builtin__'>, '__multicall__': <_MultiCall 0 results, 5 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 0x000002d00fd0e2e0>
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 0x000002d00fd0e2e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 5 meths, kwargs={'i..._builtin__'>, '__multicall__': <_MultiCall 0 results, 5 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 5 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>, '__multicall__': <_MultiCall 0 results, 5 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__'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
appdirect = (config.getoption('runappdirect') or
config.getoption('direct_apptest'))
if (get_marker(item, name='pypy_only') and
appdirect and not '__pypy__' in sys.builtin_module_names):
pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
if not appdirect:
spaceconfig.setdefault('objspace.std.reinterpretasserts', True)
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kwds = {'objspace.std.reinterpretasserts': True, 'usemodules': ['posix', 'time']}
config = <rpython.config.config.Config object at 0x000002d00fcce218>
key = (((False, False, False, True, False, False, ...), True, None, False, False, None, ...), False, (False, 'lltype', 'c', False, True, 'ref', ...))
def gettestobjspace(**kwds):
""" helper for instantiating and caching spaces for testing.
"""
try:
config = make_config(option, **kwds)
except ConflictConfigError as e:
# this exception is typically only raised if a module is not available.
# in this case the test should be skipped
py.test.skip(str(e))
if getattr(option, 'runappdirect', None):
skip_on_incompatible_interpreter(kwds)
return TinyObjSpace()
key = config.getkey()
try:
return _SPACECACHE[key]
except KeyError:
> space = maketestobjspace(config)
tool\pytest\objspace.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00fcce218>
def maketestobjspace(config=None):
if config is None:
config = make_config(option)
if config.objspace.usemodules.thread:
config.translation.thread = True
config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest'
> space = make_objspace(config)
tool\pytest\objspace.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = <rpython.config.config.Config object at 0x000002d00fcce218>
def make_objspace(config):
from pypy.objspace.std.objspace import StdObjSpace
> return StdObjSpace(config)
tool\option.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
config = <rpython.config.config.Config object at 0x000002d00fcce218>
@not_rpython
def __init__(self, config=None):
"Basic initialization of objects."
self.fromcache = InternalSpaceCache(self).getorbuild
self.threadlocals = ThreadLocals()
# set recursion limit
# sets all the internal descriptors
if config is None:
from pypy.config.pypyoption import get_pypy_config
config = get_pypy_config(translating=False)
self.config = config
self.reverse_debugging = config.translation.reverse_debugger
self.builtin_modules = {}
self.reloading_modules = {}
self.interned_strings = make_weak_value_dictionary(self, str, W_Root)
self.actionflag = ActionFlag() # changed by the signal module
self.check_signal_action = None # changed by the signal module
make_finalizer_queue(W_Root, self)
self._code_of_sys_exc_info = None
self._builtin_functions_by_identifier = {'': None}
# can be overridden to a subclass
> self.initialize()
interpreter\baseobjspace.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def initialize(self):
"""only for initializing the space
Setup all the object types and implementations.
"""
setup_prebuilt(self)
self.FrameClass = frame.build_frame(self)
self.StringObjectCls = W_BytesObject
self.UnicodeObjectCls = W_UnicodeObject
self.IntObjectCls = W_IntObject
self.FloatObjectCls = W_FloatObject
# singletons
self.w_None = W_NoneObject.w_None
self.w_False = W_BoolObject.w_False
self.w_True = W_BoolObject.w_True
self.w_NotImplemented = self.wrap(special.NotImplemented())
self.w_Ellipsis = self.wrap(special.Ellipsis())
# types
builtin_type_classes = {
W_BoolObject.typedef: W_BoolObject,
W_Buffer.typedef: W_Buffer,
W_BytearrayObject.typedef: W_BytearrayObject,
W_BytesObject.typedef: W_BytesObject,
W_ComplexObject.typedef: W_ComplexObject,
W_DictMultiObject.typedef: W_DictMultiObject,
W_FloatObject.typedef: W_FloatObject,
W_IntObject.typedef: W_IntObject,
W_AbstractSeqIterObject.typedef: W_AbstractSeqIterObject,
W_ListObject.typedef: W_ListObject,
W_LongObject.typedef: W_LongObject,
W_MemoryView.typedef: W_MemoryView,
W_NoneObject.typedef: W_NoneObject,
W_ObjectObject.typedef: W_ObjectObject,
W_SetObject.typedef: W_SetObject,
W_FrozensetObject.typedef: W_FrozensetObject,
W_SliceObject.typedef: W_SliceObject,
W_TupleObject.typedef: W_TupleObject,
W_TypeObject.typedef: W_TypeObject,
W_UnicodeObject.typedef: W_UnicodeObject,
}
self.builtin_types = {}
self._interplevel_classes = {}
for typedef, cls in builtin_type_classes.items():
w_type = self.gettypeobject(typedef)
self.builtin_types[typedef.name] = w_type
name = typedef.name
# we don't expose 'space.w_str' at all, to avoid confusion
# with Python 3. Instead, in Python 2, it becomes
# space.w_bytes (or space.w_text).
if name == 'str':
name = 'bytes'
setattr(self, 'w_' + name, w_type)
self._interplevel_classes[w_type] = cls
self.w_text = self.w_bytes # 'space.w_text' is w_unicode on Py3
self.w_dict.flag_map_or_seq = 'M'
from pypy.objspace.std import dictproxyobject
dictproxyobject._set_flag_map_or_seq(self)
self.w_list.flag_map_or_seq = 'S'
self.w_tuple.flag_map_or_seq = 'S'
self.builtin_types["NotImplemented"] = self.w_NotImplemented
self.builtin_types["Ellipsis"] = self.w_Ellipsis
self.w_basestring = self.builtin_types['basestring'] = \
self.gettypeobject(basestring_typedef)
# exceptions & builtins
self.make_builtins()
# the type of old-style classes
self.w_classobj = self.builtin.get('__metaclass__')
# final setup
> self.setup_builtin_modules()
objspace\std\objspace.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
@not_rpython
def setup_builtin_modules(self):
"only for initializing the space."
if self.config.objspace.usemodules.cpyext:
# Special-case this to have state.install_dll() called early, which
# is required to initialise sys on Windows.
from pypy.module.cpyext.state import State
self.fromcache(State).build_api()
elif self.config.objspace.usemodules._cffi_backend:
from pypy.module._cffi_backend import copy_includes
copy_includes.main()
self.getbuiltinmodule('sys')
self.getbuiltinmodule('imp')
self.getbuiltinmodule('__builtin__')
for mod in self.builtin_modules.values():
> mod.setup_after_space_initialization()
interpreter\baseobjspace.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.moduledef.Module object at 0x000002d00a18c058>
def setup_after_space_initialization(self):
from pypy.module._warnings.interp_warnings import State
> state = self.space.fromcache(State)
module\_warnings\moduledef.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
key = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'InternalSpaceCache' (15 items)>
callable = <class pypy.module._warnings.interp_warnings.State at 0x000002d008d0d638>
def _build(self, callable):
> return callable(self.space)
interpreter\baseobjspace.py:402:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d013bf2020>
space = StdObjSpace
def __init__(self, space):
> self.init_filters(space)
module\_warnings\interp_warnings.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module._warnings.interp_warnings.State instance at 0x000002d013bf2020>
space = StdObjSpace
def init_filters(self, space):
filters_w = []
> if (not space.sys.get_flag('py3k_warning') and
not space.sys.get_flag('division_warning')):
module\_warnings\interp_warnings.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012420368>
name = 'py3k_warning'
def get_flag(self, name):
space = self.space
> return space.int_w(space.getattr(self.get('flags'), space.newtext(name)))
module\sys\moduledef.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012420368>
name = 'flags'
def get(self, name):
space = self.space
> w_value = self.getdictvalue(space, name)
interpreter\mixedmodule.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012420368>
space = StdObjSpace, attr = 'flags'
def getdictvalue(self, space, attr):
""" specialize access to dynamic exc_* attributes. """
> value = MixedModule.getdictvalue(self, space, attr)
module\sys\moduledef.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.sys.moduledef.Module object at 0x000002d012420368>
space = StdObjSpace, name = 'flags'
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.sys.moduledef.Module object at 0x000002d012420368>
space = StdObjSpace, name = 'flags'
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 afileloader(space):
> return app.wget(space, attrname)
interpreter\mixedmodule.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace, name = 'null_sysflags'
def wget(self, space, name):
> w_globals = self.getwdict(space)
interpreter\gateway.py:1211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
def getwdict(self, space):
> return space.fromcache(ApplevelCache).getorbuild(self)
interpreter\gateway.py:1204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def getorbuild(self, key):
if lock: lock.acquire()
try:
try:
return self.content[key]
except KeyError:
if key in self._building:
raise RuntimeError("%s recursive building of %r" %
(self, key))
self._building[key] = True
try:
> result = self._build(key)
..\rpython\rlib\cache.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
key = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
def _build(self, key):
> return self.build(key)
interpreter\baseobjspace.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Cache 'ApplevelCache' (0 items)>
app = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
@not_rpython
def build(self, app):
"Called indirectly by Applevel.getwdict()."
> return build_applevel_dict(app, self.space)
interpreter\gateway.py:1255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ApplevelClass filename='d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'>
space = StdObjSpace
@not_rpython
def build_applevel_dict(self, space):
w_glob = space.newdict(module=True)
space.setitem(w_glob, space.newtext('__name__'), space.newtext(self.modname))
space.exec_(self.source, w_glob, w_glob,
hidden_applevel=self.hidden_applevel,
> filename=self.filename)
interpreter\gateway.py:1266:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace
statement = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0132cb4e8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0132cb4e8>)
hidden_applevel = True
filename = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\module\\sys\\app.py'
@not_rpython
def exec_(self, statement, w_globals, w_locals, hidden_applevel=False,
filename=None):
"For internal debugging."
if filename is None:
filename = '?'
from pypy.interpreter.pycode import PyCode
if isinstance(statement, str):
compiler = self.createcompiler()
statement = compiler.compile(statement, filename, 'exec', 0,
hidden_applevel=hidden_applevel)
if not isinstance(statement, PyCode):
raise TypeError('space.exec_(): expected a string, code or PyCode object')
w_key = self.newtext('__builtins__')
if not self.contains_w(w_globals, w_key):
self.setitem(w_globals, w_key, self.builtin)
> return statement.exec_code(self, w_globals, w_locals)
interpreter\baseobjspace.py:1403:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
space = StdObjSpace
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0132cb4e8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0132cb4e8>)
def exec_code(self, space, w_globals, w_locals):
"Implements the 'exec' statement."
# this should be on PyCode?
frame = space.createframe(self, w_globals, None)
frame.setdictscope(w_locals)
> return frame.run()
interpreter\eval.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> 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 <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
pycode = <code object <module>, file 'd:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2>
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d012fd93d0>
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:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 0L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d012fd93d0>
def handle_bytecode(self, co_code, next_instr, ec):
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter\pyopcode.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
co_code = 'd\x00\x00Z\x00\x00d\x01\x00d\x02\x00l\x01\x00m\x02\x00Z\x02\x00m\x03\x00Z\x03\x00\x01d\x01\x00d\x03\x00l\x04\x00Z\x04...x00Z\n\x00d\n\x00f\x00\x00d\x0b\x00\x84\x00\x00\x83\x00\x00YZ\x0b\x00e\x0b\x00d\x0c\x00\x83\x01\x00Z\x0c\x00d\x03\x00S'
next_instr = 15L
ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0x000002d012fd93d0>
@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:
# Only reload next_instr from last_instr when something that
# can modify it actually ran (trace function or action
# dispatcher). In the common case (no trace, positive ticker)
# next_instr is unchanged and the round-trip is skipped.
_d = self.debugdata
if ec.space.reverse_debugging or (
_d is not None and _d.w_f_trace is not None) or (
not we_are_translated() and
'bytecode_only_trace' in ec.__dict__):
ec.bytecode_only_trace(self)
next_instr = r_uint(self.last_instr)
actionflag = ec.space.actionflag
if actionflag.decrement_ticker(TICK_COUNTER_STEP) < 0:
actionflag.action_dispatcher(ec, 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)
interpreter\pyopcode.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object <module>, fil...uildbot64\slave\own-win-x86-64\build\pypy\module\sys\app.py', line 2> at line 6
nameindex = 1, next_instr = 15L
def IMPORT_NAME(self, nameindex, next_instr):
space = self.space
w_modulename = self.getname_w(nameindex)
w_fromlist = self.popvalue()
w_flag = self.popvalue()
try:
if space.int_w(w_flag) == -1:
w_flag = None
except OperationError as e:
if e.async(space):
raise
w_import = self.get_builtin().getdictvalue(space, '__import__')
if w_import is None:
raise oefmt(space.w_ImportError, "__import__ not found")
d = self.getdebug()
if d is None:
w_locals = None
else:
w_locals = d.w_locals
if w_locals is None: # CPython does this
w_locals = space.w_None
w_globals = self.get_w_globals()
if w_flag is None:
w_obj = space.call_function(w_import, w_modulename, w_globals,
> w_locals, w_fromlist)
interpreter\pyopcode.py:1065:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = StdObjSpace, w_func = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d013...trategy object at 0x000002d0132cb4e8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
nargs = 4, 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 = <BuiltinFunction __import__>
args_w = (W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d013...trategy object at 0x000002d0132cb4e8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')))
gateway = <module 'pypy.interpreter.gateway' from 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\interpreter\\gateway.pyc'>
PyCode = <class 'pypy.interpreter.pycode.PyCode'>
code = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
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 = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def call_args(self, args):
# delegate activation to code
> w_res = self.getcode().funcrun(self, args)
interpreter\function.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter\gateway.py:781:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
w_result = activation._run(space, scope_w)
except DescrMismatch:
if w_obj is not None:
args = args.prepend(w_obj)
return self._type_unwrap_mismatch(space, args)
except Exception as e:
> self.handle_exception(space, e)
interpreter\gateway.py:795:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
space = StdObjSpace
e = AssertionError(u'assert 0 == 2404\n + where 0 = 0\n + where 0 = <rpython.r...ython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident',)
def handle_exception(self, space, e):
try:
if not we_are_translated():
raise
raise e
except OperationError:
raise
except Exception as e: # general fall-back
from pypy.interpreter import error
> raise error.get_converted_unexpected_exception(space, e)
interpreter\gateway.py:819:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinCode object at 0x000002d0091b2e90>
func = <BuiltinFunction __import__>, w_obj = None
args = Arguments([W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std...._TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))])
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
interpreter\gateway.py:789:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.interpreter.gateway.BuiltinActivation_UwS_ObjSpace_text0_W_Root_W_Root_W_Root_int object at 0x000002d0091b3168>
space = StdObjSpace
scope_w = [W_BytesObject('_structseq'), W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d013... 0x000002d0132cb4e8>), W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield')), W_IntObject(-1)]
def _run(self, space, scope_w):
> return self.behavior(space, space.text0_w(scope_w[0]), scope_w[1], scope_w[2], scope_w[3], space.gateway_int_w(scope_w[4]))
<2148-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\tool\sourcetools.py:200>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, name = '_structseq'
w_globals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0132cb4e8>)
w_locals = W_ModuleDictObject(<pypy.objspace.std.celldict.ModuleDictStrategy object at 0x000002d0132cb4e8>)
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
level = -1
@unwrap_spec(name='text0', level=int)
def importhook(space, name, w_globals=None,
w_locals=None, w_fromlist=None, level=-1):
modulename = name
if not modulename and level < 0:
raise oefmt(space.w_ValueError, "Empty module name")
if w_fromlist is not None and not space.is_true(w_fromlist):
w_fromlist = None
rel_modulename = None
if (level != 0 and w_globals is not None and
space.isinstance_w(w_globals, space.w_dict)):
rel_modulename, rel_level = _get_relative_name(space, modulename, level,
w_globals)
if rel_modulename:
# if no level was set, ignore import errors, and
# fall back to absolute import at the end of the
# function.
if level == -1:
# This check is a fast path to avoid redoing the
# following absolute_import() in the common case
w_mod = check_sys_modules_w(space, rel_modulename)
if w_mod is not None and space.is_w(w_mod, space.w_None):
# if we already find space.w_None, it means that we
# already tried and failed and fell back to the
# end of this function.
w_mod = None
else:
w_mod = absolute_import(space, rel_modulename, rel_level,
> w_fromlist, tentative=True)
module\imp\importing.py:293:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def absolute_import(space, modulename, baselevel, w_fromlist, tentative):
# Short path: check in sys.modules, but only if there is no conflict
# on the import lock. In the situation of 'import' statements
# inside tight loops, this should be true, and absolute_import_try()
# should be followed by the JIT and turned into not much code. But
# if the import lock is currently held by another thread, then we
# have to wait, and so shouldn't use the fast path.
if not getimportlock(space).lock_held_by_someone_else():
w_mod = absolute_import_try(space, modulename, baselevel, w_fromlist)
if w_mod is not None and not space.is_w(w_mod, space.w_None):
return w_mod
return absolute_import_with_lock(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
@jit.dont_look_inside
def absolute_import_with_lock(space, modulename, baselevel,
w_fromlist, tentative):
lock = getimportlock(space)
lock.acquire_lock()
try:
return _absolute_import(space, modulename, baselevel,
> w_fromlist, tentative)
module\imp\importing.py:326:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq', baselevel = 0
w_fromlist = W_TupleObject(W_BytesObject('structseqtype'), W_BytesObject('structseqfield'))
tentative = True
def _absolute_import(space, modulename, baselevel, w_fromlist, tentative):
if '/' in modulename or '\\' in modulename:
raise oefmt(space.w_ImportError,
"Import by filename is not supported.")
w_mod = None
parts = modulename.split('.')
if parts[-1] == '':
del parts[-1]
prefix = []
w_path = None
first = None
level = 0
for part in parts:
w_mod = load_part(space, w_path, prefix, part, w_mod,
> tentative=tentative)
module\imp\importing.py:404:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, w_path = None, prefix = [], partname = '_structseq'
w_parent = None, tentative = True
def load_part(space, w_path, prefix, partname, w_parent, tentative):
modulename = '.'.join(prefix + [partname])
w_modulename = space.newtext(modulename)
w_mod = check_sys_modules(space, w_modulename)
if w_mod is not None:
if not space.is_w(w_mod, space.w_None):
return w_mod
elif not prefix or w_path is not None:
find_info = find_module(
> space, modulename, w_modulename, partname, w_path)
module\imp\importing.py:703:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = StdObjSpace, modulename = '_structseq'
w_modulename = W_BytesObject('_structseq'), partname = '_structseq'
w_path = W_ListObject(<pypy.objspace.std.listobject.BytesListStrategy object at 0x00000...ypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib-python\\2.7\\lib-tk'])
use_loader = True
def find_module(space, modulename, w_modulename, partname, w_path,
use_loader=True):
# Examin importhooks (PEP302) before doing the import
if use_loader:
w_loader = find_in_meta_path(space, w_modulename, w_path)
if w_loader:
return FindInfo.fromLoader(w_loader)
# XXX Check for frozen modules?
# when w_path is a string
delayed_builtin = None
w_lib_extensions = None
if w_path is None:
# check the builtin modules
if modulename in space.builtin_modules:
delayed_builtin = FindInfo(C_BUILTIN, modulename, None)
# a "real builtin module xx" shadows every file "xx.py" there
# could possibly be; a "pseudo-extension module" does not, and
# is only loaded at the point in sys.path where we find
# '.../lib_pypy/__extensions__'.
if modulename in space.MODULES_THAT_ALWAYS_SHADOW:
return delayed_builtin
w_lib_extensions = space.sys.get_state(space).w_lib_extensions
w_path = space.sys.get('path')
# XXX check frozen modules?
# when w_path is null
if w_path is not None:
for w_pathitem in space.unpackiterable(w_path):
# sys.path_hooks import hook
if (w_lib_extensions is not None and
space.eq_w(w_pathitem, w_lib_extensions)):
return delayed_builtin
if use_loader:
w_loader = find_in_path_hooks(space, w_modulename, w_pathitem)
if w_loader:
return FindInfo.fromLoader(w_loader)
path = space.fsencode_w(w_pathitem)
filepart = os.path.join(path, partname)
log_pyverbose(space, 2, "# trying %s\n" % (filepart,))
if os.path.isdir(filepart) and case_ok(filepart):
if has_init_module(space, filepart):
return FindInfo(PKG_DIRECTORY, filepart, None)
else:
msg = ("Not importing directory '%s' missing __init__.py" %
(filepart,))
space.warn(space.newtext(msg), space.w_ImportWarning)
modtype, suffix, filemode = find_modtype(space, filepart)
try:
if modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION):
assert suffix is not None
filename = filepart + suffix
> stream = streamio.open_file_as_stream(filename, filemode)
module\imp\importing.py:593:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
mode = 'U', buffering = -1, signal_checker = None
@specialize.argtype(0)
def open_file_as_stream(path, mode="r", buffering=-1, signal_checker=None):
os_flags, universal, reading, writing, basemode, binary = decode_mode(mode)
> stream = open_path_helper(path, os_flags, basemode == "a", signal_checker)
..\rpython\rlib\streamio.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
os_flags = 32768, append = False, signal_checker = None
@specialize.argtype(0)
def open_path_helper(path, os_flags, append, signal_checker=None):
# XXX for now always return DiskFile
> fd = rposix.open(path, os_flags, 0666)
..\rpython\rlib\streamio.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = 'd:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\lib_pypy\\_structseq.py'
flags = 32768, mode = 438
@replace_os_function('open')
@specialize.argtype(0)
@enforceargs(NOT_CONSTANT, int, int, typecheck=False)
def open(path, flags, mode):
if _WIN32:
utf8 = _as_utf80(path)
with rffi.scoped_utf82wcharp(utf8) as buf:
> fd = c_wopen(buf, flags, mode)
..\rpython\rlib\rposix.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<* DEAD Array of UniChar {'nolength': True} >, 32768, 438)
real_args = (<* DEAD Array of UniChar {'nolength': True} >, 32768L, 438L)
to_free = (), i = 2
def wrapper(*args):
assert len(args) == nb_args
real_args = ()
# XXX 'to_free' leaks if an allocation fails with MemoryError
# and was not the first in this function
to_free = ()
for i, TARGET in unrolling_arg_tps:
arg = args[i]
if TARGET == CCHARP or TARGET is VOIDP:
if arg is None:
from rpython.rtyper.annlowlevel import llstr
arg = lltype.nullptr(CCHARP.TO) # None => (char*)NULL
to_free = to_free + (arg, llstr(None), '\x04')
elif isinstance(arg, str):
tup = get_nonmovingbuffer_ll_final_null(arg)
to_free = to_free + tup
arg = tup[0]
elif isinstance(arg, unicode):
_oops()
elif TARGET == CWCHARP:
if arg is None:
arg = lltype.nullptr(CWCHARP.TO) # None => (wchar_t*)NULL
to_free = to_free + (arg,)
elif isinstance(arg, unicode):
arg = unicode2wcharp(arg)
to_free = to_free + (arg,)
elif _isfunctype(TARGET) and not _isllptr(arg):
# XXX pass additional arguments
use_gil = invoke_around_handlers
arg = llhelper(TARGET, _make_wrapper_for(TARGET, arg,
callbackholder,
use_gil))
else:
SOURCE = lltype.typeOf(arg)
if SOURCE != TARGET:
if TARGET is lltype.Float:
arg = float(arg)
elif ((isinstance(SOURCE, lltype.Number)
or SOURCE is lltype.Bool)
and (isinstance(TARGET, lltype.Number)
or TARGET is lltype.Bool)):
arg = cast(TARGET, arg)
real_args = real_args + (arg,)
> res = call_external_function(*real_args)
..\rpython\rtyper\lltypesystem\rffi.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a0 = <* DEAD Array of UniChar {'nolength': True} >, a1 = 32768L, a2 = 438L
def call_external_function(a0, a1, a2):
> rgil.release()
<104-codegen d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py:217>:4:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def release():
# this function must not raise, in such a way that the exception
# transformer knows that it cannot raise!
if we_are_translated():
_gil_release()
else:
allocate()
> _emulated_gil_holder.release()
..\rpython\rlib\rgil.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>
def release(self):
> assert self._tid == self._get_ident()
E assert 0 == 2404
E + where 0 = 0
E + where 0 = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._tid
E + and 2404 = <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>>()
E + where <bound method EmulatedGilHolder._get_ident of <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>> = <rpython.rlib.rgil.EmulatedGilHolder instance at 0x000002d0080cc920>._get_ident
..\rpython\rlib\rgil.py:131: AssertionError
==================== 1 passed, 58 error in 206.60 seconds =====================
++ 01:35:09 starting module/struct/test [116 started in total]
__ module/pyexpat/test [113 done in total, somefailed=False] __________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 21 items
module\pyexpat\test\test_build.py .
module\pyexpat\test\test_parser.py ..................ss
=================== 19 passed, 2 skipped in 197.50 seconds ====================
++ 01:35:25 starting module/sys/test [117 started in total]
__ module/signal/test [114 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 18 items
module\signal\test\test_signal.py s.s.....ss.s.sss..
=================== 10 passed, 8 skipped in 116.14 seconds ====================
++ 01:35:44 starting module/termios/test [118 started in total]
__ module/termios/test [115 done in total, somefailed=False] __________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 1.12 seconds ==========================
++ 01:35:47 starting module/test_lib_pypy [119 started in total]
__ module/struct/test [116 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 61.46 seconds ==========================
++ 01:36:17 starting module/thread/test [120 started in total]
__ module/select/test [117 done in total, somefailed=True] ____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 41 items
module\select\test\test_epoll.py ssssssss
module\select\test\test_kqueue.py sssss
module\select\test\test_select.py sssssssssssssss....E......ss
module\select\test\test_ztranslation.py .
=================================== ERRORS ====================================
_________ ERROR at teardown of AppTestSelectWithSockets.test_writable _________
self = <CallInfo when='teardown' exception: {
<C object Array of UniChar {'nolength': True} at 0x20095160e80>:
...
Fi...i.py", line 1146, in utf82wcharp
w = lltype.malloc(CWCHARP.TO, utf8len + 2, flavor='raw', track_allocation=True)
}>
func = <function <lambda> at 0x000002009d4d65c0>, when = 'teardown'
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_teardown'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_writable'>, 'nextitem': <AppTes...ults, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_writable'>, 'nextitem': <AppTestMethod 'test_write_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 0x0000020096161600>
hook = <_HookCaller 'pytest_runtest_teardown'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_writable'>, 'nextitem': <AppTes...ults, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_writable'>, 'nextitem': <AppTestMethod 'test_write_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_teardown'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_writable'>, 'nextitem': <AppTes...ults, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_writable'>, 'nextitem': <AppTestMethod 'test_write_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, 0 meths, kwargs={'item': <AppTestMethod 'test_writable'>, 'nextitem': <AppTestMethod 'test_write_read'>, '__multicall__': <_MultiCall 0 results, 0 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_teardown at 0x000002009d4d14c0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...write_read'>, '__multicall__': <_MultiCall 0 results, 0 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 0x000002009d4bc5e0>
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 0x000002009d4bc5e0>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...write_read'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
..\_pytest\vendored_packages\pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_writable'>, 'nextitem': <AppTestMethod 'test_write_read'>, '__multicall__': <_MultiCall 0 results, 0 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:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.conftest.LeakFinder instance at 0x0000020097a264e0>
item = <AppTestMethod 'test_writable'>
@pytest.hookimpl(trylast=True)
def pytest_runtest_teardown(self, item):
if not isinstance(item, py.test.collect.Function):
return
if (not getattr(item.obj, 'dont_track_allocations', False)
and leakfinder.TRACK_ALLOCATIONS):
kwds = {}
try:
kwds['do_collection'] = item.track_allocations_collect
except AttributeError:
pass
item._pypytest_leaks = leakfinder.stop_tracking_allocations(False,
**kwds)
else: # stop_tracking_allocations() already called
item._pypytest_leaks = None
# check for leaks, but only if the test passed so far
if getattr(item, '_success', False) and item._pypytest_leaks:
> raise leakfinder.MallocMismatch(item._pypytest_leaks)
E MallocMismatch: {
E
E <C object Array of UniChar {'nolength': True} at 0x20095160e80>:
E ...
E File "d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rlib\rposix.py", line 467, in open
E with rffi.scoped_utf82wcharp(utf8) as buf:
E File "d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py", line 1415, in __init__
E self.buf = utf82wcharp(value, rutf8.codepoints_in_utf8(value))
E File "d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\rpython\rtyper\lltypesystem\rffi.py", line 1146, in utf82wcharp
E w = lltype.malloc(CWCHARP.TO, utf8len + 2, flavor='raw', track_allocation=True)
E }
..\rpython\conftest.py:103: MallocMismatch
============== 11 passed, 30 skipped, 1 error in 258.41 seconds ===============
++ 01:36:51 starting module/time/test [121 started in total]
__ module/test_lib_pypy [118 done in total, somefailed=False] _________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 232 items / 5 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 .
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_stackless.py ..............................
module\test_lib_pypy\test_stackless_pickling.py ..
module\test_lib_pypy\test_structseq.py .........
module\test_lib_pypy\test_tputil.py ..s....
=================== 230 passed, 7 skipped in 71.56 seconds ====================
++ 01:37:02 starting module/unicodedata/test [122 started in total]
__ module/sys/test [119 done in total, somefailed=False] ______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
collected 65 items
module\sys\test\apptest_initpath.py .
module\sys\test\test_encoding.py s
module\sys\test\test_initpath.py .s.....
module\sys\test\test_sysmodule.py ..............................ss....................
module\sys\test\test_version.py ....
==================== 61 passed, 4 skipped in 94.48 seconds ====================
++ 01:37:02 starting module/zipimport/test [123 started in total]
__ module/unicodedata/test [120 done in total, somefailed=False] ______________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 40.17 seconds ==========================
++ 01:37:47 starting module/zlib/test [124 started in total]
__ module/time/test [121 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 18 items
module\time\test\test_time.py ...........s......
==================== 17 passed, 1 skipped in 64.41 seconds ====================
++ 01:37:58 starting objspace/fake/test [125 started in total]
__ module/zlib/test [122 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 31 items
module\zlib\test\test_zlib.py ...............................
========================= 31 passed in 49.67 seconds ==========================
++ 01:38:40 starting objspace/std/test [126 started in total]
__ module/zipimport/test [123 done in total, somefailed=False] ________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 67 items
module\zipimport\test\test_undocumented.py ......
module\zipimport\test\test_zipimport.py ........................................
module\zipimport\test\test_zipimport_deflated.py .....................
========================= 67 passed in 152.24 seconds =========================
++ 01:39:36 starting objspace/test [127 started in total]
__ objspace/fake/test [124 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 95.48 seconds ==========================
++ 01:39:42 starting sandbox/test [128 started in total]
__ sandbox/test [125 done in total, somefailed=False] _________________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 0 items / 1 skipped
========================== 1 skipped in 6.23 seconds ==========================
++ 01:39:49 starting tool/bench/test [129 started in total]
__ tool/bench/test [126 done in total, somefailed=False] ______________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 3 items / 1 skipped
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
tool\bench\test\test_pypyresult.py ...
===================== 3 passed, 1 skipped in 5.24 seconds =====================
++ 01:39:57 starting tool/memusage/test [130 started in total]
__ module/thread/test [127 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 48 items
module\thread\test\test_fork.py sss
module\thread\test\test_gil.py ....
module\thread\test\test_import_lock.py .....
module\thread\test\test_local.py .......
module\thread\test\test_lock.py .............sss.
module\thread\test\test_thread.py ..........s.
=================== 41 passed, 7 skipped in 224.70 seconds ====================
++ 01:40:04 starting tool/pytest/test [131 started in total]
__ objspace/test [128 done in total, somefailed=False] ________________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
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 24.99 seconds ====================
++ 01:40:05 starting tool/release/test [132 started in total]
__ tool/memusage/test [129 done in total, somefailed=False] ___________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 5 items
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
tool\memusage\test\test_log2gnumeric.py .....
========================== 5 passed in 8.05 seconds ===========================
++ 01:40:08 starting tool/test [133 started in total]
__ tool/test [130 done in total, somefailed=False] ____________________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 34.72 seconds ==========================
__ tool/release/test [131 done in total, somefailed=False] ____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
collected 8 items
tool\release\test\test_package.py ...ss
tool\release\test\test_smartstrip.py sss
==================== 3 passed, 5 skipped in 45.31 seconds =====================
__ tool/pytest/test [132 done in total, somefailed=False] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\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 134.85 seconds =========================
__ objspace/std/test [133 done in total, somefailed=True] _____________________
============================= test session starts =============================
platform win32 -- Python 2.7.18[pypy-7.3.18-alpha], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('d:\\pypy_stuff\\buildbot64\\slave\\own-win-x86-64\\build\\pypy\\.hypothesis\\examples')
pytest-2.9.2 from d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pytest.pyc
rootdir: d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build, inifile: pytest.ini
plugins: hypothesis-4.39.3
[platform:msg] Updated environment with vsver 160, using x64 True
[platform:msg] Updated environment with vsver 160, using x64 True
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 ..............
objspace\std\test\apptest_operation.py ...
objspace\std\test\apptest_stringformat.py ...............s...........................s........
objspace\std\test\apptest_userobject.py ......................
objspace\std\test\test_boolobject.py .......
objspace\std\test\test_bytearrayobject.py .......................................................
objspace\std\test\test_bytesobject.py ......................................................................s.......
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 ...................................F..
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..................................................................
objspace\std\test\test_longobject.py .........................................
objspace\std\test\test_mapdict.py ...............................................................................................................................................
objspace\std\test\test_memoryobject.py .......
objspace\std\test\test_methodcache.py .......................................................................
objspace\std\test\test_newformat.py .......................................................................................s........
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.....................................................................................F..................................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........................................................s.................
objspace\std\test\test_userobject.py .
objspace\std\test\test_versionedtype.py ...............
================================== FAILURES ===================================
___________________ AppTestFloatHex.test_division_edgecases ___________________
self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x000001c876b28ad8>
def test_division_edgecases(self):
import math, os
# inf
inf = float("inf")
assert math.isnan(inf % 3)
assert math.isnan(inf // 3)
x, y = divmod(inf, 3)
assert math.isnan(x)
assert math.isnan(y)
x, y = divmod(3, inf)
z = 3 % inf
if os.name == 'nt':
> assert math.isnan(x)
E (application-level) AssertionError: assert <built-in function isnan>(0.0)
E + where <built-in function isnan> = <built-in function isnan>
E + where <built-in function isnan> = <module 'math' (built-in)>.isnan
[d:\pypy_stuff\buildbot64\slave\own-win-x86-64\build\pypy\objspace\std\test\test_floatobject.py:825]:14: AssertionError
_________________ TestW_IntObject.test_lshift_without_fromint _________________
self = <pypy.objspace.std.test.test_intobject.TestW_IntObject instance at 0x000001c872ac9560>
monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0x000001c872ac95a0>
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 = 2305843009213693951, 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
_________________ TestW_IntObject.test_lshift_without_fromint _________________
self = <pypy.objspace.std.test.test_intobject.TestW_IntObject instance at 0x000001c86f90f220>
monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0x000001c86f90f260>
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 = 2305843009213693951, 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
__________ TestW_IntObjectWithSmallLong.test_lshift_without_fromint ___________
self = <pypy.objspace.std.test.test_smalllongobject.TestW_IntObjectWithSmallLong instance at 0x000001c816ede060>
monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0x000001c816ede0a0>
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 = 2305843009213693951, 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\test_floatobject.py::AppTestFloatHex::()::test_division_edgecases
FAIL objspace\std\test\test_intobject.py::TestW_IntObject::()::test_lshift_without_fromint
FAIL objspace\std\test\test_smalllongobject.py::TestW_IntObject::()::test_lshift_without_fromint
FAIL objspace\std\test\test_smalllongobject.py::TestW_IntObjectWithSmallLong::()::test_lshift_without_fromint
============= 4 failed, 2095 passed, 31 skipped in 259.35 seconds =============
program finished with exit code 1
elapsedTime=2536.152000