0s autopkgtest [13:07:06]: starting date and time: 2024-11-13 13:07:06+0000 0s autopkgtest [13:07:06]: git checkout: 6f3be7a8 Fix armhf LXD image generation for plucky 0s autopkgtest [13:07:06]: host juju-7f2275-prod-proposed-migration-environment-20; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.zqgj4lu6/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python3-defaults,src:python3-stdlib-extensions --apt-upgrade python-bytecode --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 '--env=ADT_TEST_TRIGGERS=python3-defaults/3.12.7-1 python3-stdlib-extensions/3.12.7-1' -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest-s390x --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-20@bos03-s390x-5.secgroup --name adt-plucky-s390x-python-bytecode-20241113-130706-juju-7f2275-prod-proposed-migration-environment-20-ad167431-b663-411a-9972-3acba88c5239 --image adt/ubuntu-plucky-s390x-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-20 --net-id=net_prod-proposed-migration-s390x -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 113s autopkgtest [13:08:59]: testbed dpkg architecture: s390x 113s autopkgtest [13:08:59]: testbed apt version: 2.9.8 113s autopkgtest [13:08:59]: @@@@@@@@@@@@@@@@@@@@ test bed setup 114s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 114s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [16.5 kB] 114s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [7016 B] 114s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [967 kB] 114s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [104 kB] 114s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x Packages [107 kB] 115s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/universe s390x Packages [641 kB] 115s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse s390x Packages [17.4 kB] 115s Fetched 1934 kB in 1s (1816 kB/s) 115s Reading package lists... 117s Reading package lists... 117s Building dependency tree... 117s Reading state information... 117s Calculating upgrade... 117s The following NEW packages will be installed: 117s python3.13-gdbm 117s The following packages will be upgraded: 117s libgpgme11t64 libpython3-stdlib python3 python3-gdbm python3-minimal 117s 5 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 117s Need to get 252 kB of archives. 117s After this operation, 98.3 kB of additional disk space will be used. 117s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3-minimal s390x 3.12.7-1 [27.4 kB] 118s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3 s390x 3.12.7-1 [24.0 kB] 118s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x libpython3-stdlib s390x 3.12.7-1 [10.0 kB] 118s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x python3.13-gdbm s390x 3.13.0-2 [31.0 kB] 118s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3-gdbm s390x 3.12.7-1 [8642 B] 118s Get:6 http://ftpmaster.internal/ubuntu plucky/main s390x libgpgme11t64 s390x 1.23.2-5ubuntu4 [151 kB] 118s Fetched 252 kB in 0s (603 kB/s) 118s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55510 files and directories currently installed.) 118s Preparing to unpack .../python3-minimal_3.12.7-1_s390x.deb ... 118s Unpacking python3-minimal (3.12.7-1) over (3.12.6-0ubuntu1) ... 118s Setting up python3-minimal (3.12.7-1) ... 118s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55510 files and directories currently installed.) 118s Preparing to unpack .../python3_3.12.7-1_s390x.deb ... 118s Unpacking python3 (3.12.7-1) over (3.12.6-0ubuntu1) ... 118s Preparing to unpack .../libpython3-stdlib_3.12.7-1_s390x.deb ... 118s Unpacking libpython3-stdlib:s390x (3.12.7-1) over (3.12.6-0ubuntu1) ... 118s Selecting previously unselected package python3.13-gdbm. 118s Preparing to unpack .../python3.13-gdbm_3.13.0-2_s390x.deb ... 118s Unpacking python3.13-gdbm (3.13.0-2) ... 118s Preparing to unpack .../python3-gdbm_3.12.7-1_s390x.deb ... 118s Unpacking python3-gdbm:s390x (3.12.7-1) over (3.12.6-1ubuntu1) ... 118s Preparing to unpack .../libgpgme11t64_1.23.2-5ubuntu4_s390x.deb ... 118s Unpacking libgpgme11t64:s390x (1.23.2-5ubuntu4) over (1.18.0-4.1ubuntu4) ... 118s Setting up libgpgme11t64:s390x (1.23.2-5ubuntu4) ... 118s Setting up python3.13-gdbm (3.13.0-2) ... 118s Setting up libpython3-stdlib:s390x (3.12.7-1) ... 118s Setting up python3 (3.12.7-1) ... 119s Setting up python3-gdbm:s390x (3.12.7-1) ... 119s Processing triggers for man-db (2.12.1-3) ... 119s Processing triggers for libc-bin (2.40-1ubuntu3) ... 119s Reading package lists... 119s Building dependency tree... 119s Reading state information... 119s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 120s Hit:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease 120s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 120s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 120s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 121s Reading package lists... 121s Reading package lists... 121s Building dependency tree... 121s Reading state information... 121s Calculating upgrade... 121s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 121s Reading package lists... 121s Building dependency tree... 121s Reading state information... 121s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 124s autopkgtest [13:09:10]: testbed running kernel: Linux 6.11.0-8-generic #8-Ubuntu SMP Mon Sep 16 12:49:35 UTC 2024 124s autopkgtest [13:09:10]: @@@@@@@@@@@@@@@@@@@@ apt-source python-bytecode 126s Get:1 http://ftpmaster.internal/ubuntu plucky/universe python-bytecode 0.15.1-3 (dsc) [2738 B] 126s Get:2 http://ftpmaster.internal/ubuntu plucky/universe python-bytecode 0.15.1-3 (tar) [93.8 kB] 126s Get:3 http://ftpmaster.internal/ubuntu plucky/universe python-bytecode 0.15.1-3 (diff) [9036 B] 126s gpgv: Signature made Wed Dec 27 19:06:00 2023 UTC 126s gpgv: using RSA key 7E1AC3FA27A649284C323EF6695C429316C07BFE 126s gpgv: issuer "jdg@debian.org" 126s gpgv: Can't check signature: No public key 126s dpkg-source: warning: cannot verify inline signature for ./python-bytecode_0.15.1-3.dsc: no acceptable signature found 126s autopkgtest [13:09:12]: testing package python-bytecode version 0.15.1-3 127s autopkgtest [13:09:13]: build not needed 127s autopkgtest [13:09:13]: test pytest: preparing testbed 130s Reading package lists... 130s Building dependency tree... 130s Reading state information... 130s Starting pkgProblemResolver with broken count: 0 130s Starting 2 pkgProblemResolver with broken count: 0 130s Done 130s The following additional packages will be installed: 130s fonts-font-awesome fonts-lato libjs-jquery libjs-sphinxdoc libjs-underscore 130s libpython3.13-minimal libpython3.13-stdlib python-bytecode-doc python3-all 130s python3-bytecode python3-iniconfig python3-packaging python3-pluggy 130s python3-pytest python3.13 python3.13-minimal sphinx-rtd-theme-common 130s Suggested packages: 130s python3.13-venv python3.13-doc binfmt-support 130s Recommended packages: 130s javascript-common 130s The following NEW packages will be installed: 130s autopkgtest-satdep fonts-font-awesome fonts-lato libjs-jquery 130s libjs-sphinxdoc libjs-underscore libpython3.13-minimal libpython3.13-stdlib 130s python-bytecode-doc python3-all python3-bytecode python3-iniconfig 130s python3-packaging python3-pluggy python3-pytest python3.13 130s python3.13-minimal sphinx-rtd-theme-common 130s 0 upgraded, 18 newly installed, 0 to remove and 0 not upgraded. 130s Need to get 11.2 MB/11.2 MB of archives. 130s After this operation, 40.5 MB of additional disk space will be used. 130s Get:1 /tmp/autopkgtest.6nojvn/1-autopkgtest-satdep.deb autopkgtest-satdep s390x 0 [732 B] 130s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x fonts-lato all 2.015-1 [2781 kB] 131s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x libpython3.13-minimal s390x 3.13.0-2 [877 kB] 132s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x python3.13-minimal s390x 3.13.0-2 [2172 kB] 132s Get:5 http://ftpmaster.internal/ubuntu plucky/main s390x fonts-font-awesome all 5.0.10+really4.7.0~dfsg-4.1 [516 kB] 132s Get:6 http://ftpmaster.internal/ubuntu plucky/main s390x libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 132s Get:7 http://ftpmaster.internal/ubuntu plucky/main s390x libjs-underscore all 1.13.4~dfsg+~1.11.4-3 [118 kB] 132s Get:8 http://ftpmaster.internal/ubuntu plucky/main s390x libjs-sphinxdoc all 7.4.7-4 [158 kB] 132s Get:9 http://ftpmaster.internal/ubuntu plucky/main s390x libpython3.13-stdlib s390x 3.13.0-2 [2086 kB] 132s Get:10 http://ftpmaster.internal/ubuntu plucky/main s390x sphinx-rtd-theme-common all 3.0.1+dfsg-1 [1012 kB] 132s Get:11 http://ftpmaster.internal/ubuntu plucky/universe s390x python-bytecode-doc all 0.15.1-3 [64.6 kB] 132s Get:12 http://ftpmaster.internal/ubuntu plucky/main s390x python3.13 s390x 3.13.0-2 [719 kB] 133s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3-all s390x 3.12.7-1 [890 B] 133s Get:14 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-bytecode all 0.15.1-3 [44.7 kB] 133s Get:15 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-iniconfig all 1.1.1-2 [6024 B] 133s Get:16 http://ftpmaster.internal/ubuntu plucky/main s390x python3-packaging all 24.1-1 [41.4 kB] 133s Get:17 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pluggy all 1.5.0-1 [21.0 kB] 133s Get:18 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pytest all 8.3.3-1 [251 kB] 133s Fetched 11.2 MB in 2s (4983 kB/s) 133s Selecting previously unselected package fonts-lato. 133s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55517 files and directories currently installed.) 133s Preparing to unpack .../00-fonts-lato_2.015-1_all.deb ... 133s Unpacking fonts-lato (2.015-1) ... 133s Selecting previously unselected package libpython3.13-minimal:s390x. 133s Preparing to unpack .../01-libpython3.13-minimal_3.13.0-2_s390x.deb ... 133s Unpacking libpython3.13-minimal:s390x (3.13.0-2) ... 133s Selecting previously unselected package python3.13-minimal. 133s Preparing to unpack .../02-python3.13-minimal_3.13.0-2_s390x.deb ... 133s Unpacking python3.13-minimal (3.13.0-2) ... 133s Selecting previously unselected package fonts-font-awesome. 133s Preparing to unpack .../03-fonts-font-awesome_5.0.10+really4.7.0~dfsg-4.1_all.deb ... 133s Unpacking fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 133s Selecting previously unselected package libjs-jquery. 133s Preparing to unpack .../04-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 133s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 133s Selecting previously unselected package libjs-underscore. 133s Preparing to unpack .../05-libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb ... 133s Unpacking libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 133s Selecting previously unselected package libjs-sphinxdoc. 133s Preparing to unpack .../06-libjs-sphinxdoc_7.4.7-4_all.deb ... 133s Unpacking libjs-sphinxdoc (7.4.7-4) ... 133s Selecting previously unselected package libpython3.13-stdlib:s390x. 133s Preparing to unpack .../07-libpython3.13-stdlib_3.13.0-2_s390x.deb ... 133s Unpacking libpython3.13-stdlib:s390x (3.13.0-2) ... 133s Selecting previously unselected package sphinx-rtd-theme-common. 133s Preparing to unpack .../08-sphinx-rtd-theme-common_3.0.1+dfsg-1_all.deb ... 133s Unpacking sphinx-rtd-theme-common (3.0.1+dfsg-1) ... 133s Selecting previously unselected package python-bytecode-doc. 133s Preparing to unpack .../09-python-bytecode-doc_0.15.1-3_all.deb ... 133s Unpacking python-bytecode-doc (0.15.1-3) ... 133s Selecting previously unselected package python3.13. 133s Preparing to unpack .../10-python3.13_3.13.0-2_s390x.deb ... 133s Unpacking python3.13 (3.13.0-2) ... 133s Selecting previously unselected package python3-all. 133s Preparing to unpack .../11-python3-all_3.12.7-1_s390x.deb ... 133s Unpacking python3-all (3.12.7-1) ... 133s Selecting previously unselected package python3-bytecode. 133s Preparing to unpack .../12-python3-bytecode_0.15.1-3_all.deb ... 133s Unpacking python3-bytecode (0.15.1-3) ... 133s Selecting previously unselected package python3-iniconfig. 133s Preparing to unpack .../13-python3-iniconfig_1.1.1-2_all.deb ... 133s Unpacking python3-iniconfig (1.1.1-2) ... 133s Selecting previously unselected package python3-packaging. 133s Preparing to unpack .../14-python3-packaging_24.1-1_all.deb ... 133s Unpacking python3-packaging (24.1-1) ... 133s Selecting previously unselected package python3-pluggy. 133s Preparing to unpack .../15-python3-pluggy_1.5.0-1_all.deb ... 133s Unpacking python3-pluggy (1.5.0-1) ... 133s Selecting previously unselected package python3-pytest. 133s Preparing to unpack .../16-python3-pytest_8.3.3-1_all.deb ... 133s Unpacking python3-pytest (8.3.3-1) ... 133s Selecting previously unselected package autopkgtest-satdep. 133s Preparing to unpack .../17-1-autopkgtest-satdep.deb ... 133s Unpacking autopkgtest-satdep (0) ... 133s Setting up python3-iniconfig (1.1.1-2) ... 134s Setting up fonts-lato (2.015-1) ... 134s Setting up libpython3.13-minimal:s390x (3.13.0-2) ... 134s Setting up python3-packaging (24.1-1) ... 134s Setting up python3-bytecode (0.15.1-3) ... 134s Setting up python3-pluggy (1.5.0-1) ... 134s Setting up python3.13-minimal (3.13.0-2) ... 135s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 135s Setting up libpython3.13-stdlib:s390x (3.13.0-2) ... 135s Setting up fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 135s Setting up sphinx-rtd-theme-common (3.0.1+dfsg-1) ... 135s Setting up libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 135s Setting up python3.13 (3.13.0-2) ... 136s Setting up python3-pytest (8.3.3-1) ... 137s Setting up python3-all (3.12.7-1) ... 137s Setting up libjs-sphinxdoc (7.4.7-4) ... 137s Setting up python-bytecode-doc (0.15.1-3) ... 137s Setting up autopkgtest-satdep (0) ... 137s Processing triggers for man-db (2.12.1-3) ... 137s Processing triggers for systemd (256.5-2ubuntu4) ... 139s (Reading database ... 56652 files and directories currently installed.) 139s Removing autopkgtest-satdep (0) ... 139s autopkgtest [13:09:25]: test pytest: [----------------------- 140s Testing with python3.13: 140s ============================= test session starts ============================== 140s platform linux -- Python 3.13.0, pytest-8.3.3, pluggy-1.5.0 140s rootdir: /tmp/autopkgtest.6nojvn/autopkgtest_tmp 140s plugins: typeguard-4.4.1 140s collected 165 items 140s 141s tests/test_bytecode.py F..sFFFsFFF...F..F.F..F..Fsss.FF.F [ 20%] 143s tests/test_cfg.py ....F.........FF.FFFFF....FFFFFFFFFFFFFFFF [ 46%] 143s tests/test_code.py FFFFFF [ 49%] 145s tests/test_concrete.py FF.FF.F..FF..F.FFFF..FF..FFFFFsFFFFFFFFFFFFFFFF [ 78%] 145s tests/test_flags.py ..ss.. [ 81%] 145s tests/test_instr.py ......FF...............F [ 96%] 145s tests/test_misc.py .FF.F. [100%] 145s 145s =================================== FAILURES =================================== 145s _________________ BytecodeTests.test_cellvar_freevar_roundtrip _________________ 145s 145s self = 145s 145s def test_cellvar_freevar_roundtrip(self): 145s from . import cell_free_vars_cases as cfc 145s 145s def recompile_code_and_inner(code): 145s bytecode = Bytecode.from_code( 145s code, 145s conserve_exception_block_stackdepth=True, 145s ) 145s for instr in bytecode: 145s if isinstance(instr, Instr) and isinstance(instr.arg, types.CodeType): 145s instr.arg = recompile_code_and_inner(instr.arg) 145s as_code = bytecode.to_code( 145s stacksize=code.co_stacksize, 145s compute_exception_stack_depths=False, 145s ) 145s self.assertCodeObjectEqual(code, as_code) 145s return as_code 145s 145s for f in cfc.TEST_CASES: 145s print(f.__name__) 145s with self.subTest(f.__name__): 145s origin = f.__code__ 145s > f.__code__ = recompile_code_and_inner(origin) 145s 145s tests/test_bytecode.py:711: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_bytecode.py:693: in recompile_code_and_inner 145s bytecode = Bytecode.from_code( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 94 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ----------------------------- Captured stdout call ----------------------------- 145s simple_cellvar 145s ____________________________ BytecodeTests.test_eq _____________________________ 145s 145s self = 145s 145s def test_eq(self): 145s code = get_code( 145s """ 145s if test: 145s x = 1 145s else: 145s x = 2 145s """ 145s ) 145s > b1 = Bytecode.from_code(code) 145s 145s tests/test_bytecode.py:139: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ________________________ BytecodeTests.test_eq_with_try ________________________ 145s 145s self = 145s 145s def test_eq_with_try(self): 145s code = get_code( 145s """ 145s try: 145s x = 1 145s except Exception: 145s pass 145s finally: 145s print() 145s """ 145s ) 145s > b1 = Bytecode.from_code(code) 145s 145s tests/test_bytecode.py:154: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ________________ BytecodeTests.test_exception_table_round_trip _________________ 145s 145s self = 145s 145s def test_exception_table_round_trip(self): 145s from . import exception_handling_cases as ehc 145s 145s for f in ehc.TEST_CASES: 145s print(f.__name__) 145s with self.subTest(f.__name__): 145s origin = f.__code__ 145s > bytecode = Bytecode.from_code( 145s origin, 145s conserve_exception_block_stackdepth=True, 145s ) 145s 145s tests/test_bytecode.py:673: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ----------------------------- Captured stdout call ----------------------------- 145s try_except_group 145s _________________________ BytecodeTests.test_from_code _________________________ 145s 145s self = 145s 145s def test_from_code(self): 145s code = get_code( 145s """ 145s if test: 145s x = 1 145s else: 145s x = 2 145s """ 145s ) 145s > bytecode = Bytecode.from_code(code) 145s 145s tests/test_bytecode.py:167: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ____________________ BytecodeTests.test_from_code_freevars _____________________ 145s 145s self = 145s 145s def test_from_code_freevars(self): 145s ns = {} 145s exec( 145s textwrap.dedent( 145s """ 145s def create_func(): 145s x = 1 145s def func(): 145s return x 145s return func 145s 145s func = create_func() 145s """ 145s ), 145s ns, 145s ns, 145s ) 145s code = ns["func"].__code__ 145s 145s > bytecode = Bytecode.from_code(code) 145s 145s tests/test_bytecode.py:259: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 62 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ____________________ BytecodeTests.test_from_code_load_fast ____________________ 145s 145s self = 145s 145s def test_from_code_load_fast(self): 145s code = get_code( 145s """ 145s def func(): 145s x = 33 145s y = x 145s """, 145s function=True, 145s ) 145s > code = Bytecode.from_code(code) 145s 145s tests/test_bytecode.py:285: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s __ BytecodeTests.test_negative_size_binary_with_disable_check_of_pre_and_post __ 145s 145s self = 145s 145s def test_negative_size_binary_with_disable_check_of_pre_and_post(self): 145s operations = ( 145s "SUBSCR", # Subscr is special 145s "POWER", 145s "MULTIPLY", 145s "MATRIX_MULTIPLY", 145s "FLOOR_DIVIDE", 145s "TRUE_DIVIDE", 145s "ADD", 145s "SUBTRACT", 145s "LSHIFT", 145s "RSHIFT", 145s "AND", 145s "XOR", 145s "OR", 145s ) 145s if sys.version_info >= (3, 11): 145s operations += ("REMAINDER",) 145s else: 145s operations += ("MODULO",) 145s 145s for opname in operations: 145s ops = (opname,) 145s if opname != "SUBSCR": 145s ops += ("INPLACE_" + opname,) 145s for op in ops: 145s with self.subTest(op): 145s code = Bytecode() 145s code.first_lineno = 1 145s if sys.version_info >= (3, 11): 145s if op == "SUBSCR": 145s i = Instr("BINARY_SUBSCR") 145s else: 145s i = Instr("BINARY_OP", getattr(BinaryOp, op)) 145s else: 145s if "INPLACE" not in op: 145s op = "BINARY_" + op 145s i = Instr(op) 145s 145s code.extend([Instr("LOAD_CONST", 1), i]) 145s > co = code.to_code(check_pre_and_post=False) 145s 145s tests/test_bytecode.py:493: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 145s bc = self.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 83 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _ BytecodeTests.test_negative_size_build_const_map_with_disable_check_of_pre_and_post _ 145s 145s self = 145s 145s def test_negative_size_build_const_map_with_disable_check_of_pre_and_post(self): 145s code = Bytecode() 145s code.first_lineno = 1 145s code.extend([Instr("LOAD_CONST", ("a",)), Instr("BUILD_CONST_KEY_MAP", 1)]) 145s > co = code.to_code(check_pre_and_post=False) 145s 145s tests/test_bytecode.py:559: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 145s bc = self.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 83 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _ BytecodeTests.test_negative_size_build_map_with_disable_check_of_pre_and_post _ 145s 145s self = 145s 145s def test_negative_size_build_map_with_disable_check_of_pre_and_post(self): 145s code = Bytecode() 145s code.first_lineno = 1 145s code.extend([Instr("LOAD_CONST", 1), Instr("BUILD_MAP", 1)]) 145s > co = code.to_code(check_pre_and_post=False) 145s 145s tests/test_bytecode.py:545: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 145s bc = self.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 83 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s __ BytecodeTests.test_negative_size_unary_with_disable_check_of_pre_and_post ___ 145s 145s self = 145s 145s def test_negative_size_unary_with_disable_check_of_pre_and_post(self): 145s opnames = ( 145s "UNARY_POSITIVE", 145s "UNARY_NEGATIVE", 145s "UNARY_NOT", 145s "UNARY_INVERT", 145s ) 145s for opname in opnames: 145s # Replaced by an intrinsic in 3.12 145s if sys.version_info >= (3, 12) and opname == "UNARY_POSITIVE": 145s continue 145s with self.subTest(opname): 145s code = Bytecode() 145s code.first_lineno = 1 145s code.extend([Instr(opname)]) 145s > co = code.to_code(check_pre_and_post=False) 145s 145s tests/test_bytecode.py:407: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 145s bc = self.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 42 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ____ BytecodeTests.test_not_enough_copy_with_disable_check_of_pre_and_post _____ 145s 145s self = 145s 145s def test_not_enough_copy_with_disable_check_of_pre_and_post(self): 145s if sys.version_info < (3, 11): 145s self.skipTest("Instruction COPY does not exist before 3.11") 145s code = Bytecode() 145s code.first_lineno = 1 145s code.extend([Instr("LOAD_CONST", 1), Instr("COPY", 2)]) 145s > co = code.to_code(check_pre_and_post=False) 145s 145s tests/test_bytecode.py:619: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 145s bc = self.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 83 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ____ BytecodeTests.test_not_enough_swap_with_disable_check_of_pre_and_post _____ 145s 145s self = 145s 145s def test_not_enough_swap_with_disable_check_of_pre_and_post(self): 145s if sys.version_info < (3, 11): 145s self.skipTest("Instruction SWAP does not exist before 3.11") 145s code = Bytecode() 145s code.first_lineno = 1 145s code.extend([Instr("LOAD_CONST", 1), Instr("SWAP", 2)]) 145s > co = code.to_code(check_pre_and_post=False) 145s 145s tests/test_bytecode.py:637: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 145s bc = self.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 83 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _________________________ BytecodeTests.test_setlineno _________________________ 145s 145s self = 145s 145s def test_setlineno(self): 145s # x = 7 145s # y = 8 145s # z = 9 145s code = Bytecode() 145s code.first_lineno = 3 145s code.extend( 145s [ 145s Instr("LOAD_CONST", 7), 145s Instr("STORE_NAME", "x"), 145s SetLineno(4), 145s Instr("LOAD_CONST", 8), 145s Instr("STORE_NAME", "y"), 145s SetLineno(5), 145s Instr("LOAD_CONST", 9), 145s Instr("STORE_NAME", "z"), 145s ] 145s ) 145s 145s > concrete = code.to_concrete_bytecode() 145s 145s tests/test_bytecode.py:330: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 83 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s __________________________ BytecodeTests.test_to_code __________________________ 145s 145s self = 145s 145s def test_to_code(self): 145s code = Bytecode() 145s code.first_lineno = 50 145s code.extend( 145s [ 145s Instr("LOAD_NAME", "print"), 145s Instr("LOAD_CONST", "%s"), 145s Instr( 145s "LOAD_GLOBAL", (False, "a") if sys.version_info >= (3, 11) else "a" 145s ), 145s Instr("BINARY_OP", BinaryOp.ADD) 145s if sys.version_info >= (3, 11) 145s else Instr("BINARY_ADD"), 145s ] 145s # For 3.12+ we need a NULL before a CALL to a free function 145s + ([Instr("PUSH_NULL")] if sys.version_info >= (3, 12) else []) 145s + [ 145s # On 3.11 we should have a pre-call 145s Instr("CALL" if sys.version_info >= (3, 11) else "CALL_FUNCTION", 1), 145s Instr("RETURN_VALUE"), 145s ] 145s ) 145s > co = code.to_code() 145s 145s tests/test_bytecode.py:367: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 145s bc = self.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 92 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ________________________ BytecodeBlocksTests.test_attr _________________________ 145s 145s self = 145s 145s def test_attr(self): 145s source = """ 145s first_line = 1 145s 145s def func(arg1, arg2, *, arg3): 145s x = 1 145s y = 2 145s return arg1 145s """ 145s > code = disassemble(source, filename="hello.py", function=True) 145s 145s tests/test_cfg.py:133: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:30: in disassemble 145s code = _disassemble(source, filename=filename, function=function) 145s tests/__init__.py:143: in disassemble 145s return Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ____________________ BytecodeBlocksFunctionalTests.test_eq _____________________ 145s 145s self = 145s 145s def test_eq(self): 145s # compare codes with multiple blocks and labels, 145s # Code.__eq__() renumbers labels to get equal labels 145s source = "x = 1 if test else 2" 145s > code1 = disassemble(source) 145s 145s tests/test_cfg.py:480: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:30: in disassemble 145s code = _disassemble(source, filename=filename, function=function) 145s tests/__init__.py:143: in disassemble 145s return Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ____________ BytecodeBlocksFunctionalTests.test_eq_with_try_except _____________ 145s 145s self = 145s 145s def test_eq_with_try_except(self): 145s source = "try:\n x = 1\nexcept Exception:\n pass\nfinally:\n print()" 145s > code1 = disassemble(source) 145s 145s tests/test_cfg.py:499: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:30: in disassemble 145s code = _disassemble(source, filename=filename, function=function) 145s tests/__init__.py:143: in disassemble 145s return Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ________________ BytecodeBlocksFunctionalTests.test_split_block ________________ 145s 145s self = 145s 145s def test_split_block(self): 145s > code = self.sample_code() 145s 145s tests/test_cfg.py:528: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:517: in sample_code 145s code = disassemble("x = 1", remove_last_return_none=True) 145s tests/test_cfg.py:30: in disassemble 145s code = _disassemble(source, filename=filename, function=function) 145s tests/__init__.py:143: in disassemble 145s return Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s __________ BytecodeBlocksFunctionalTests.test_split_block_dont_split ___________ 145s 145s self = 145s 145s def test_split_block_dont_split(self): 145s > code = self.sample_code() 145s 145s tests/test_cfg.py:581: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:517: in sample_code 145s code = disassemble("x = 1", remove_last_return_none=True) 145s tests/test_cfg.py:30: in disassemble 145s code = _disassemble(source, filename=filename, function=function) 145s tests/__init__.py:143: in disassemble 145s return Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ______________ BytecodeBlocksFunctionalTests.test_split_block_end ______________ 145s 145s self = 145s 145s def test_split_block_end(self): 145s > code = self.sample_code() 145s 145s tests/test_cfg.py:558: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:517: in sample_code 145s code = disassemble("x = 1", remove_last_return_none=True) 145s tests/test_cfg.py:30: in disassemble 145s code = _disassemble(source, filename=filename, function=function) 145s tests/__init__.py:143: in disassemble 145s return Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _____________ BytecodeBlocksFunctionalTests.test_split_block_error _____________ 145s 145s self = 145s 145s def test_split_block_error(self): 145s > code = self.sample_code() 145s 145s tests/test_cfg.py:591: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:517: in sample_code 145s code = disassemble("x = 1", remove_last_return_none=True) 145s tests/test_cfg.py:30: in disassemble 145s code = _disassemble(source, filename=filename, function=function) 145s tests/__init__.py:143: in disassemble 145s return Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s __________________ BytecodeBlocksFunctionalTests.test_to_code __________________ 145s 145s self = 145s 145s def test_to_code(self): 145s # test resolution of jump labels 145s bytecode = ControlFlowGraph() 145s bytecode.first_lineno = 3 145s bytecode.argcount = 3 145s bytecode.posonlyargcount = 0 145s bytecode.kwonlyargcount = 2 145s bytecode.name = "func" 145s bytecode.filename = "hello.py" 145s bytecode.flags = 0x43 145s bytecode.argnames = ("arg", "arg2", "arg3", "kwonly", "kwonly2") 145s bytecode.docstring = None 145s block0 = bytecode[0] 145s block1 = bytecode.add_block() 145s block2 = bytecode.add_block() 145s block0.extend( 145s [ 145s Instr("LOAD_FAST", "x", lineno=4), 145s Instr( 145s "POP_JUMP_FORWARD_IF_FALSE" 145s if (3, 12) > sys.version_info >= (3, 11) 145s else "POP_JUMP_IF_FALSE", 145s block2, 145s lineno=4, 145s ), 145s ] 145s ) 145s block1.extend( 145s [Instr("LOAD_FAST", "arg", lineno=5), Instr("STORE_FAST", "x", lineno=5)] 145s ) 145s block2.extend( 145s [ 145s Instr("LOAD_CONST", 3, lineno=6), 145s Instr("STORE_FAST", "x", lineno=6), 145s Instr("LOAD_FAST", "x", lineno=7), 145s Instr("RETURN_VALUE", lineno=7), 145s ] 145s ) 145s 145s if sys.version_info >= (3, 11): 145s # jump is relative not absolute 145s expected = ( 145s b"|\x05" b"r\x02" b"|\x00" b"}\x05" b"d\x01" b"}\x05" b"|\x05" b"S\x00" 145s ) 145s elif OFFSET_AS_INSTRUCTION: 145s # The argument of the jump is divided by 2 145s expected = ( 145s b"|\x05" b"r\x04" b"|\x00" b"}\x05" b"d\x01" b"}\x05" b"|\x05" b"S\x00" 145s ) 145s else: 145s expected = ( 145s b"|\x05" b"r\x08" b"|\x00" b"}\x05" b"d\x01" b"}\x05" b"|\x05" b"S\x00" 145s ) 145s 145s > code = bytecode.to_code() 145s 145s tests/test_cfg.py:651: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/cfg.py:1057: in to_code 145s return bc.to_code( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 145s bc = self.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 145s return converter.to_concrete_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 145s self.concrete_instructions() 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 145s self.required_caches = c_instr.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 85 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _________ CFGStacksizeComputationTests.test_stack_size_computation_and _________ 145s 145s self = 145s 145s def test_stack_size_computation_and(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s return arg1 and args # Test JUMP_IF_FALSE_OR_POP 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:730: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s __ CFGStacksizeComputationTests.test_stack_size_computation_for_loop_continue __ 145s 145s self = 145s 145s def test_stack_size_computation_for_loop_continue(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s for k in kwargs: 145s if k in args: 145s continue 145s else: 145s return 1 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:757: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _______ CFGStacksizeComputationTests.test_stack_size_computation_if_else _______ 145s 145s self = 145s 145s def test_stack_size_computation_if_else(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s if args: 145s return 0 145s elif kwargs: 145s return 1 145s else: 145s return 2 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:747: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _ CFGStacksizeComputationTests.test_stack_size_computation_nested_try_except_else_finally _ 145s 145s self = 145s 145s def test_stack_size_computation_nested_try_except_else_finally(self): 145s def test(*args, **kwargs): 145s try: 145s v = args[1] 145s except IndexError: 145s try: 145s w = kwargs["value"] 145s except KeyError: 145s return -1 145s else: 145s return w 145s finally: 145s print("second finally") 145s else: 145s return v 145s finally: 145s print("first finally") 145s 145s # A direct comparison of the stack depth fails because CPython 145s # generate dead code that is used in stack computation. 145s cpython_stacksize = test.__code__.co_stacksize 145s > test.__code__ = Bytecode.from_code(test.__code__).to_code() 145s 145s tests/test_cfg.py:856: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _ CFGStacksizeComputationTests.test_stack_size_computation_nested_try_except_finally _ 145s 145s self = 145s 145s def test_stack_size_computation_nested_try_except_finally(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s k = 1 145s try: 145s getattr(arg1, k) 145s except AttributeError: 145s pass 145s except Exception: 145s try: 145s assert False 145s except Exception: 145s return 2 145s finally: 145s print("unexpected") 145s finally: 145s print("attempted to get {}".format(k)) 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:833: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _________ CFGStacksizeComputationTests.test_stack_size_computation_or __________ 145s 145s self = 145s 145s def test_stack_size_computation_or(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s return arg1 or args # Test JUMP_IF_TRUE_OR_POP 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:736: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _____ CFGStacksizeComputationTests.test_stack_size_computation_try_except ______ 145s 145s self = 145s 145s def test_stack_size_computation_try_except(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s try: 145s return args[0] 145s except Exception: 145s return 2 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:781: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _ CFGStacksizeComputationTests.test_stack_size_computation_try_except_else_finally _ 145s 145s self = 145s 145s def test_stack_size_computation_try_except_else_finally(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s try: 145s return args[0] 145s except Exception: 145s return 2 145s else: 145s return arg1 145s finally: 145s print("Interrupt") 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:814: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _ CFGStacksizeComputationTests.test_stack_size_computation_try_except_finally __ 145s 145s self = 145s 145s def test_stack_size_computation_try_except_finally(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s try: 145s return args[0] 145s except Exception: 145s return 2 145s finally: 145s print("Interrupt") 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:801: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s _____ CFGStacksizeComputationTests.test_stack_size_computation_try_finally _____ 145s 145s self = 145s 145s def test_stack_size_computation_try_finally(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s try: 145s return args[0] 145s finally: 145s return 2 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:790: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s __ CFGStacksizeComputationTests.test_stack_size_computation_while_loop_break ___ 145s 145s self = 145s 145s def test_stack_size_computation_while_loop_break(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s while True: 145s if arg1: 145s break 145s 145s > self.check_stack_size(test) 145s 145s tests/test_cfg.py:765: 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s tests/test_cfg.py:692: in check_stack_size 145s bytecode = Bytecode.from_code(code) 145s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 145s return concrete.to_bytecode( 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 145s target = c_instr.get_jump_target(offset) 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 145s ) + self.use_cache_opcodes() 145s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 145s 145s self = 145s 145s def use_cache_opcodes(self) -> int: 145s return ( 145s # Not supposed to be used but we need it 145s > dis._inline_cache_entries[self._opcode] # type: ignore 145s if sys.version_info >= (3, 11) 145s else 0 145s ) 145s E KeyError: 149 145s 145s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 145s ________ CFGStacksizeComputationTests.test_stack_size_computation_with _________ 145s 145s self = 145s 145s def test_stack_size_computation_with(self): 145s def test(arg1, *args, **kwargs): # pragma: no cover 145s with open(arg1) as f: 146s return f.read() 146s 146s > self.check_stack_size(test) 146s 146s tests/test_cfg.py:772: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_cfg.py:692: in check_stack_size 146s bytecode = Bytecode.from_code(code) 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _________ CFGStacksizeComputationTests.test_stack_size_with_dead_code __________ 146s 146s self = 146s 146s def test_stack_size_with_dead_code(self): 146s # Simply demonstrate more directly the previously mentioned issue. 146s def test(*args): # pragma: no cover 146s a = 0 146s return a 146s try: 146s a = args[0] 146s except IndexError: 146s return -1 146s else: 146s return a 146s 146s > test.__code__ = Bytecode.from_code(test.__code__).to_code() 146s 146s tests/test_cfg.py:882: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _________ CFGStacksizeComputationTests.test_stack_size_with_dead_code2 _________ 146s 146s self = 146s 146s def test_stack_size_with_dead_code2(self): 146s # See GH #118 146s source = """ 146s try: 146s pass 146s except Exception as e: 146s pass 146s """ 146s source = textwrap.dedent(source).strip() 146s code = compile(source, "", "exec") 146s > bytecode = Bytecode.from_code(code) 146s 146s tests/test_cfg.py:896: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _______________ CFGRoundTripTests.test_cellvar_freevar_roundtrip _______________ 146s 146s self = 146s 146s def test_cellvar_freevar_roundtrip(self): 146s from . import cell_free_vars_cases as cfc 146s 146s def recompile_code_and_inner(code): 146s cfg = ControlFlowGraph.from_bytecode(Bytecode.from_code(code)) 146s for block in cfg: 146s for instr in block: 146s if isinstance(instr.arg, types.CodeType): 146s instr.arg = recompile_code_and_inner(instr.arg) 146s as_code = cfg.to_code() 146s self.assertCodeObjectEqual(code, as_code) 146s return as_code 146s 146s for f in cfc.TEST_CASES: 146s print(f.__name__) 146s with self.subTest(f.__name__): 146s origin = f.__code__ 146s > f.__code__ = recompile_code_and_inner(origin) 146s 146s tests/test_cfg.py:980: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_cfg.py:967: in recompile_code_and_inner 146s cfg = ControlFlowGraph.from_bytecode(Bytecode.from_code(code)) 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 94 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ----------------------------- Captured stdout call ----------------------------- 146s simple_cellvar 146s _____________ CFGRoundTripTests.test_roundtrip_exception_handling ______________ 146s 146s self = 146s 146s def test_roundtrip_exception_handling(self): 146s from . import exception_handling_cases as ehc 146s 146s for f in ehc.TEST_CASES: 146s # 3.12 use one less exception table entry causing to optimize this case 146s # less than we could otherwise 146s if sys.version_info >= (3, 12) and f.__name__ == "try_except_finally": 146s continue 146s print(f.__name__) 146s with self.subTest(f.__name__): 146s origin = f.__code__ 146s print("Bytecode:") 146s > bytecode = Bytecode.from_code( 146s f.__code__, conserve_exception_block_stackdepth=True 146s ) 146s 146s tests/test_cfg.py:947: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ----------------------------- Captured stdout call ----------------------------- 146s try_except_group 146s Bytecode: 146s __________________________ CodeTests.test_async_func ___________________________ 146s 146s self = 146s 146s def test_async_func(self): 146s > self.check( 146s """ 146s async def func(arg, arg2): 146s pass 146s """, 146s function=True, 146s ) 146s 146s tests/test_code.py:79: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_code.py:14: in check 146s code = ConcreteBytecode.from_code(ref_code).to_code() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 35 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ________________________ CodeTests.test_generator_func _________________________ 146s 146s self = 146s 146s def test_generator_func(self): 146s > self.check( 146s """ 146s def func(arg, arg2): 146s yield 146s """, 146s function=True, 146s ) 146s 146s tests/test_code.py:70: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_code.py:14: in check 146s code = ConcreteBytecode.from_code(ref_code).to_code() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 35 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ____________________________ CodeTests.test_kwargs _____________________________ 146s 146s self = 146s 146s def test_kwargs(self): 146s > self.check( 146s """ 146s def func(a, b, **kwargs): 146s pass 146s """, 146s function=True, 146s ) 146s 146s tests/test_code.py:50: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_code.py:14: in check 146s code = ConcreteBytecode.from_code(ref_code).to_code() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s __________________________ CodeTests.test_kwonlyargs ___________________________ 146s 146s self = 146s 146s def test_kwonlyargs(self): 146s > self.check( 146s """ 146s def func(*, arg, arg2): 146s pass 146s """, 146s function=True, 146s ) 146s 146s tests/test_code.py:59: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_code.py:14: in check 146s code = ConcreteBytecode.from_code(ref_code).to_code() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _____________________________ CodeTests.test_loop ______________________________ 146s 146s self = 146s 146s def test_loop(self): 146s > self.check( 146s """ 146s for x in range(1, 10): 146s x += 1 146s if x == 3: 146s continue 146s x -= 1 146s if x > 7: 146s break 146s x = 0 146s print(x) 146s """ 146s ) 146s 146s tests/test_code.py:26: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_code.py:14: in check 146s code = ConcreteBytecode.from_code(ref_code).to_code() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ____________________________ CodeTests.test_varargs ____________________________ 146s 146s self = 146s 146s def test_varargs(self): 146s > self.check( 146s """ 146s def func(a, b, *varargs): 146s pass 146s """, 146s function=True, 146s ) 146s 146s tests/test_code.py:41: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_code.py:14: in check 146s code = ConcreteBytecode.from_code(ref_code).to_code() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _______________________ ConcreteInstrTests.test_assemble _______________________ 146s 146s self = 146s 146s def test_assemble(self): 146s instr = ConcreteInstr("NOP") 146s > self.assertEqual(instr.assemble(), b"\t\x00") 146s E AssertionError: b'\x1e\x00' != b'\t\x00' 146s 146s tests/test_concrete.py:146: AssertionError 146s _________________________ ConcreteInstrTests.test_attr _________________________ 146s 146s self = 146s 146s def test_attr(self): 146s instr = ConcreteInstr("LOAD_CONST", 5, lineno=12) 146s self.assertEqual(instr.name, "LOAD_CONST") 146s > self.assertEqual(instr.opcode, 100) 146s E AssertionError: 83 != 100 146s 146s tests/test_concrete.py:63: AssertionError 146s _____________________ ConcreteInstrTests.test_disassemble ______________________ 146s 146s self = 146s 146s def test_disassemble(self): 146s code = b"\t\x00d\x03" 146s instr = ConcreteInstr.disassemble(1, code, 0) 146s > self.assertEqual(instr, ConcreteInstr("NOP", lineno=1)) 146s E AssertionError: != 146s 146s tests/test_concrete.py:134: AssertionError 146s ___________________ ConcreteInstrTests.test_get_jump_target ____________________ 146s 146s self = 146s 146s def test_get_jump_target(self): 146s if sys.version_info < (3, 11): 146s jump_abs = ConcreteInstr("JUMP_ABSOLUTE", 3) 146s self.assertEqual(jump_abs.get_jump_target(100), 3) 146s 146s jump_forward = ConcreteInstr("JUMP_FORWARD", 5) 146s self.assertEqual( 146s > jump_forward.get_jump_target(10), 16 if OFFSET_AS_INSTRUCTION else 17 146s ) 146s 146s tests/test_concrete.py:170: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 79 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _______________________ ConcreteInstrTests.test_set_attr _______________________ 146s 146s self = 146s 146s def test_set_attr(self): 146s instr = ConcreteInstr("LOAD_CONST", 5, lineno=12) 146s 146s # operator name 146s instr.name = "LOAD_FAST" 146s self.assertEqual(instr.name, "LOAD_FAST") 146s > self.assertEqual(instr.opcode, 124) 146s E AssertionError: 85 != 124 146s 146s tests/test_concrete.py:93: AssertionError 146s ______________________ ConcreteBytecodeTests.test_cellvar ______________________ 146s 146s self = 146s 146s def test_cellvar(self): 146s concrete = ConcreteBytecode() 146s concrete.cellvars = ["x"] 146s concrete.append(ConcreteInstr("LOAD_DEREF", 0)) 146s > code = concrete.to_code() 146s 146s tests/test_concrete.py:469: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 84 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s __________________ ConcreteBytecodeTests.test_cellvar_freevar __________________ 146s 146s self = 146s 146s def test_cellvar_freevar(self): 146s concrete = ConcreteBytecode() 146s concrete.cellvars = ["cell"] 146s concrete.freevars = ["free"] 146s concrete.append(ConcreteInstr("LOAD_DEREF", 0)) 146s concrete.append(ConcreteInstr("LOAD_DEREF", 1)) 146s > code = concrete.to_code() 146s 146s tests/test_concrete.py:509: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 84 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ________________________ ConcreteBytecodeTests.test_eq _________________________ 146s 146s self = 146s 146s def test_eq(self): 146s code = ConcreteBytecode() 146s self.assertFalse(code == 1) 146s 146s for name, val in ( 146s ("names", ["a"]), 146s ("varnames", ["a"]), 146s ("consts", [1]), 146s ("argcount", 1), 146s ("kwonlyargcount", 2), 146s ("flags", CompilerFlags(CompilerFlags.GENERATOR)), 146s ("first_lineno", 10), 146s ("filename", "xxxx.py"), 146s ("name", "__x"), 146s ("docstring", "x-x-x"), 146s ("cellvars", [CellVar("x")]), 146s ("freevars", [FreeVar("x")]), 146s ): 146s c = ConcreteBytecode() 146s setattr(c, name, val) 146s # For obscure reasons using assertNotEqual here fail 146s self.assertFalse(code == c) 146s 146s c = ConcreteBytecode() 146s c.posonlyargcount = 10 146s self.assertFalse(code == c) 146s 146s c = ConcreteBytecode() 146s c.consts = [1] 146s code.consts = [1] 146s c.append(ConcreteInstr("LOAD_CONST", 0)) 146s > self.assertFalse(code == c) 146s 146s tests/test_concrete.py:225: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:320: in __eq__ 146s return super().__eq__(other) 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:91: in __eq__ 146s if self.compute_stacksize() != other.compute_stacksize(): 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:846: in compute_stacksize 146s bytecode = self.to_bytecode() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ________________ ConcreteBytecodeTests.test_explicit_stacksize _________________ 146s 146s self = 146s 146s def test_explicit_stacksize(self): 146s # Passing stacksize=... to ConcreteBytecode.to_code should result in a 146s # code object with the specified stacksize. We pass some silly values 146s # and assert that they are honored. 146s code_obj = get_code("print('%s' % (a,b,c))") 146s original_stacksize = code_obj.co_stacksize 146s concrete = ConcreteBytecode.from_code(code_obj) 146s 146s # First with something bigger than necessary. 146s explicit_stacksize = original_stacksize + 42 146s new_code_obj = concrete.to_code( 146s stacksize=explicit_stacksize, compute_exception_stack_depths=False 146s ) 146s self.assertEqual(new_code_obj.co_stacksize, explicit_stacksize) 146s 146s # Then with something bogus. We probably don't want to advertise this 146s # in the documentation. If this fails then decide if it's for good 146s # reason, and remove if so. 146s explicit_stacksize = 0 146s new_code_obj = concrete.to_code( 146s stacksize=explicit_stacksize, compute_exception_stack_depths=False 146s ) 146s > self.assertEqual(new_code_obj.co_stacksize, explicit_stacksize) 146s E AssertionError: 1 != 0 146s 146s tests/test_concrete.py:614: AssertionError 146s __________________ ConcreteBytecodeTests.test_extended_lnotab __________________ 146s 146s self = 146s 146s def test_extended_lnotab(self): 146s # x = 7 146s # 200 blank lines 146s # y = 8 146s concrete = ConcreteBytecode( 146s [ 146s ConcreteInstr("LOAD_CONST", 0), 146s SetLineno(1 + 128), 146s ConcreteInstr("STORE_NAME", 0), 146s # line number goes backward! 146s SetLineno(1 + 129), 146s ConcreteInstr("LOAD_CONST", 1), 146s SetLineno(1), 146s ConcreteInstr("STORE_NAME", 1), 146s ] 146s ) 146s concrete.consts = [7, 8] 146s concrete.names = ["x", "y"] 146s concrete.first_lineno = 1 146s 146s > code = concrete.to_code() 146s 146s tests/test_concrete.py:365: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _________________ ConcreteBytecodeTests.test_extended_lnotab2 __________________ 146s 146s self = 146s 146s def test_extended_lnotab2(self): 146s # x = 7 146s # 200 blank lines 146s # y = 8 146s base_code = compile("x = 7" + "\n" * 200 + "y = 8", "", "exec") 146s concrete = ConcreteBytecode( 146s ( 146s [ConcreteInstr("RESUME", 0, lineno=0), SetLineno(1)] 146s if sys.version_info >= (3, 11) 146s else [] 146s ) 146s + [ 146s ConcreteInstr("LOAD_CONST", 0), 146s ConcreteInstr("STORE_NAME", 0), 146s SetLineno(201), 146s ConcreteInstr("LOAD_CONST", 1), 146s ConcreteInstr("STORE_NAME", 1), 146s ] 146s + ( 146s [ConcreteInstr("RETURN_CONST", 2)] 146s if sys.version_info >= (3, 12) 146s else [ 146s ConcreteInstr("LOAD_CONST", 2), 146s ConcreteInstr("RETURN_VALUE"), 146s ] 146s ) 146s ) 146s concrete.consts = [None, 7, 8] 146s concrete.names = ["x", "y"] 146s concrete.first_lineno = 1 146s 146s > code = concrete.to_code() 146s 146s tests/test_concrete.py:415: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ______________________ ConcreteBytecodeTests.test_freevar ______________________ 146s 146s self = 146s 146s def test_freevar(self): 146s concrete = ConcreteBytecode() 146s concrete.freevars = ["x"] 146s concrete.append(ConcreteInstr("LOAD_DEREF", 0)) 146s > code = concrete.to_code() 146s 146s tests/test_concrete.py:488: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 84 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s __________________ ConcreteBytecodeTests.test_load_classderef __________________ 146s 146s self = 146s 146s def test_load_classderef(self): 146s i_name = ( 146s "LOAD_FROM_DICT_OR_DEREF" 146s if sys.version_info >= (3, 12) 146s else "LOAD_CLASSDEREF" 146s ) 146s i_arg = 2 if sys.version_info >= (3, 11) else 1 146s concrete = ConcreteBytecode() 146s concrete.varnames = ["a"] 146s concrete.cellvars = ["__class__"] 146s concrete.freevars = ["__class__"] 146s concrete.extend( 146s [ 146s ConcreteInstr("LOAD_FAST", 0, lineno=1), 146s ConcreteInstr(i_name, i_arg, lineno=1), 146s ConcreteInstr("STORE_DEREF", i_arg, lineno=1), 146s ] 146s ) 146s 146s > bytecode = concrete.to_bytecode() 146s 146s tests/test_concrete.py:551: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 85 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s __________________ ConcreteBytecodeTests.test_negative_lnotab __________________ 146s 146s self = 146s 146s def test_negative_lnotab(self): 146s # x = 7 146s # y = 8 146s concrete = ConcreteBytecode( 146s [ 146s ConcreteInstr("LOAD_CONST", 0), 146s ConcreteInstr("STORE_NAME", 0), 146s # line number goes backward! 146s SetLineno(2), 146s ConcreteInstr("LOAD_CONST", 1), 146s ConcreteInstr("STORE_NAME", 1), 146s ] 146s ) 146s concrete.consts = [7, 8] 146s concrete.names = ["x", "y"] 146s concrete.first_lineno = 5 146s 146s > code = concrete.to_code() 146s 146s tests/test_concrete.py:337: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ________________ ConcreteBytecodeTests.test_to_bytecode_consts _________________ 146s 146s self = 146s 146s def test_to_bytecode_consts(self): 146s # x = -0.0 146s # x = +0.0 146s # 146s # code optimized by the CPython 3.6 peephole optimizer which emits 146s # duplicated constants (0.0 is twice in consts). 146s code = ConcreteBytecode() 146s code.consts = [0.0, None, -0.0, 0.0] 146s code.names = ["x", "y"] 146s code.extend( 146s [ 146s ConcreteInstr("LOAD_CONST", 2, lineno=1), 146s ConcreteInstr("STORE_NAME", 0, lineno=1), 146s ConcreteInstr("LOAD_CONST", 3, lineno=2), 146s ConcreteInstr("STORE_NAME", 1, lineno=2), 146s ConcreteInstr("LOAD_CONST", 1, lineno=2), 146s ConcreteInstr("RETURN_VALUE", lineno=2), 146s ] 146s ) 146s 146s > code = code.to_bytecode().to_concrete_bytecode() 146s 146s tests/test_concrete.py:448: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s __________________ ConcreteBytecodeTests.test_to_code_lnotab ___________________ 146s 146s self = 146s 146s def test_to_code_lnotab(self): 146s # We use an actual function for the simple case to 146s # ensure we get lnotab right 146s def f(): 146s # 146s # 146s x = 7 # noqa 146s y = 8 # noqa 146s z = 9 # noqa 146s 146s fl = f.__code__.co_firstlineno 146s concrete = ConcreteBytecode() 146s concrete.consts = [None, 7, 8, 9] 146s concrete.varnames = ["x", "y", "z"] 146s concrete.first_lineno = fl 146s concrete.extend( 146s ( 146s [ConcreteInstr("RESUME", 0), SetLineno(1)] 146s if sys.version_info >= (3, 11) 146s else [] 146s ) 146s + [ 146s SetLineno(fl + 3), 146s ConcreteInstr("LOAD_CONST", 1), 146s ConcreteInstr("STORE_FAST", 0), 146s SetLineno(fl + 4), 146s ConcreteInstr("LOAD_CONST", 2), 146s ConcreteInstr("STORE_FAST", 1), 146s SetLineno(fl + 5), 146s ConcreteInstr("LOAD_CONST", 3), 146s ConcreteInstr("STORE_FAST", 2), 146s ] 146s + ( 146s [ConcreteInstr("RETURN_CONST", 0)] 146s if sys.version_info >= (3, 12) 146s else [ 146s ConcreteInstr("LOAD_CONST", 0), 146s ConcreteInstr("RETURN_VALUE"), 146s ] 146s ) 146s ) 146s 146s > code = concrete.to_code() 146s 146s tests/test_concrete.py:308: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _____________ ConcreteFromCodeTests.test_cellvar_freevar_roundtrip _____________ 146s 146s self = 146s 146s def test_cellvar_freevar_roundtrip(self): 146s from . import cell_free_vars_cases as cfc 146s 146s def recompile_code_and_inner(code): 146s concrete = ConcreteBytecode.from_code(code) 146s for i, c in enumerate(concrete.consts): 146s if isinstance(c, types.CodeType): 146s concrete.consts[i] = recompile_code_and_inner(c) 146s as_code = concrete.to_code( 146s stacksize=code.co_stacksize, compute_exception_stack_depths=False 146s ) 146s self.assertCodeObjectEqual(code, as_code) 146s return as_code 146s 146s for f in cfc.TEST_CASES: 146s print(f.__name__) 146s with self.subTest(f.__name__): 146s origin = f.__code__ 146s > f.__code__ = recompile_code_and_inner(origin) 146s 146s tests/test_concrete.py:1323: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/test_concrete.py:1312: in recompile_code_and_inner 146s concrete.consts[i] = recompile_code_and_inner(c) 146s tests/test_concrete.py:1316: in recompile_code_and_inner 146s self.assertCodeObjectEqual(code, as_code) 146s tests/__init__.py:171: in assertCodeObjectEqual 146s self.assertSequenceEqual( 146s E AssertionError: Sequences differ: [(Non[63 chars], 19, 20), (25, 25, 15, 20), (25, 25, 15, 20), (25, 25, 8, 20)] != [(Non[63 chars], 19, 20), (25, 25, 15, 20), (25, 25, 8, 20)] 146s E 146s E First differing element 5: 146s E (25, 25, 15, 20) 146s E (25, 25, 8, 20) 146s E 146s E First sequence contains 1 additional elements. 146s E First extra element 6: 146s E (25, 25, 8, 20) 146s E 146s E [(None, None, None, None), 146s E (24, 24, 0, 0), 146s E (25, 25, 15, 16), 146s E (25, 25, 19, 20), 146s E (25, 25, 15, 20), 146s E - (25, 25, 15, 20), 146s E (25, 25, 8, 20)] 146s ----------------------------- Captured stdout call ----------------------------- 146s simple_cellvar 146s cellvar_share_name 146s cellvar_shared_and_unshared 146s ____________ ConcreteFromCodeTests.test_exception_table_round_trip _____________ 146s 146s self = 146s 146s def test_exception_table_round_trip(self): 146s from . import exception_handling_cases as ehc 146s 146s for f in ehc.TEST_CASES: 146s print(f.__name__) 146s with self.subTest(f.__name__): 146s origin = f.__code__ 146s concrete = ConcreteBytecode.from_code(f.__code__) 146s as_code = concrete.to_code( 146s stacksize=f.__code__.co_stacksize, 146s compute_exception_stack_depths=False, 146s ) 146s > self.assertCodeObjectEqual(origin, as_code) 146s 146s tests/test_concrete.py:1297: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/__init__.py:171: in assertCodeObjectEqual 146s self.assertSequenceEqual( 146s E AssertionError: Sequences differ: [(2, [157 chars] (5, 5, 12, 22), (5, 5, 12, 22), (5, 5, 12, 22[783 chars]one)] != [(2, [157 chars] (5, 6, 4, 21), (5, 6, 4, 21), (5, 6, 4, 21), [566 chars]one)] 146s E 146s E First differing element 10: 146s E (5, 5, 12, 22) 146s E (5, 6, 4, 21) 146s E 146s E First sequence contains 13 additional elements. 146s E First extra element 40: 146s E (None, None, None, None) 146s E 146s E Diff is 1155 characters long. Set self.maxDiff to None to see it. 146s ----------------------------- Captured stdout call ----------------------------- 146s try_except_group 146s ___________ ConcreteFromCodeTests.test_expected_arg_with_many_consts ___________ 146s 146s self = 146s 146s def test_expected_arg_with_many_consts(self): 146s def test(): 146s var = 0 146s var = 1 146s var = 2 146s var = 3 146s var = 4 146s var = 5 146s var = 6 146s var = 7 146s var = 8 146s var = 9 146s var = 10 146s var = 11 146s var = 12 146s var = 13 146s var = 14 146s var = 15 146s var = 16 146s var = 17 146s var = 18 146s var = 19 146s var = 20 146s var = 21 146s var = 22 146s var = 23 146s var = 24 146s var = 25 146s var = 26 146s var = 27 146s var = 28 146s var = 29 146s var = 30 146s var = 31 146s var = 32 146s var = 33 146s var = 34 146s var = 35 146s var = 36 146s var = 37 146s var = 38 146s var = 39 146s var = 40 146s var = 41 146s var = 42 146s var = 43 146s var = 44 146s var = 45 146s var = 46 146s var = 47 146s var = 48 146s var = 49 146s var = 50 146s var = 51 146s var = 52 146s var = 53 146s var = 54 146s var = 55 146s var = 56 146s var = 57 146s var = 58 146s var = 59 146s var = 60 146s var = 61 146s var = 62 146s var = 63 146s var = 64 146s var = 65 146s var = 66 146s var = 67 146s var = 68 146s var = 69 146s var = 70 146s var = 71 146s var = 72 146s var = 73 146s var = 74 146s var = 75 146s var = 76 146s var = 77 146s var = 78 146s var = 79 146s var = 80 146s var = 81 146s var = 82 146s var = 83 146s var = 84 146s var = 85 146s var = 86 146s var = 87 146s var = 88 146s var = 89 146s var = 90 146s var = 91 146s var = 92 146s var = 93 146s var = 94 146s var = 95 146s var = 96 146s var = 97 146s var = 98 146s var = 99 146s var = 100 146s var = 101 146s var = 102 146s var = 103 146s var = 104 146s var = 105 146s var = 106 146s var = 107 146s var = 108 146s var = 109 146s var = 110 146s var = 111 146s var = 112 146s var = 113 146s var = 114 146s var = 115 146s var = 116 146s var = 117 146s var = 118 146s var = 119 146s var = 120 146s var = 121 146s var = 122 146s var = 123 146s var = 124 146s var = 125 146s var = 126 146s var = 127 146s var = 128 146s var = 129 146s var = 130 146s var = 131 146s var = 132 146s var = 133 146s var = 134 146s var = 135 146s var = 136 146s var = 137 146s var = 138 146s var = 139 146s var = 140 146s var = 141 146s var = 142 146s var = 143 146s var = 144 146s var = 145 146s var = 146 146s var = 147 146s var = 148 146s var = 149 146s var = 150 146s var = 151 146s var = 152 146s var = 153 146s var = 154 146s var = 155 146s var = 156 146s var = 157 146s var = 158 146s var = 159 146s var = 160 146s var = 161 146s var = 162 146s var = 163 146s var = 164 146s var = 165 146s var = 166 146s var = 167 146s var = 168 146s var = 169 146s var = 170 146s var = 171 146s var = 172 146s var = 173 146s var = 174 146s var = 175 146s var = 176 146s var = 177 146s var = 178 146s var = 179 146s var = 180 146s var = 181 146s var = 182 146s var = 183 146s var = 184 146s var = 185 146s var = 186 146s var = 187 146s var = 188 146s var = 189 146s var = 190 146s var = 191 146s var = 192 146s var = 193 146s var = 194 146s var = 195 146s var = 196 146s var = 197 146s var = 198 146s var = 199 146s var = 200 146s var = 201 146s var = 202 146s var = 203 146s var = 204 146s var = 205 146s var = 206 146s var = 207 146s var = 208 146s var = 209 146s var = 210 146s var = 211 146s var = 212 146s var = 213 146s var = 214 146s var = 215 146s var = 216 146s var = 217 146s var = 218 146s var = 219 146s var = 220 146s var = 221 146s var = 222 146s var = 223 146s var = 224 146s var = 225 146s var = 226 146s var = 227 146s var = 228 146s var = 229 146s var = 230 146s var = 231 146s var = 232 146s var = 233 146s var = 234 146s var = 235 146s var = 236 146s var = 237 146s var = 238 146s var = 239 146s var = 240 146s var = 241 146s var = 242 146s var = 243 146s var = 244 146s var = 245 146s var = 246 146s var = 247 146s var = 248 146s var = 249 146s var = 250 146s var = 251 146s var = 252 146s var = 253 146s var = 254 146s var = 255 146s var = 256 146s var = 257 146s var = 258 146s var = 259 146s 146s return var 146s 146s test.__code__ = ConcreteBytecode.from_code( 146s test.__code__, extended_arg=True 146s > ).to_code() 146s 146s tests/test_concrete.py:1187: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ____________ ConcreteFromCodeTests.test_extended_arg_make_function _____________ 146s 146s self = 146s 146s def test_extended_arg_make_function(self): 146s if (3, 9) <= sys.version_info < (3, 10): 146s from .util_annotation import get_code as get_code_future 146s 146s code_obj = get_code_future( 146s """ 146s def foo(x: int, y: int): 146s pass 146s """ 146s ) 146s else: 146s code_obj = get_code( 146s """ 146s def foo(x: int, y: int): 146s pass 146s """ 146s ) 146s 146s # without EXTENDED_ARG 146s concrete = ConcreteBytecode.from_code(code_obj) 146s if sys.version_info >= (3, 11): 146s func_code = concrete.consts[2] 146s names = ["int", "foo"] 146s consts = ["x", "y", func_code, None] 146s const_offset = 1 146s name_offset = 1 146s first_instrs = [ 146s ConcreteInstr("LOAD_CONST", 0, lineno=1), 146s ConcreteInstr("LOAD_NAME", 0, lineno=1), 146s ConcreteInstr("LOAD_CONST", 1, lineno=1), 146s ConcreteInstr("LOAD_NAME", 0, lineno=1), 146s ConcreteInstr("BUILD_TUPLE", 4, lineno=1), 146s ] 146s elif sys.version_info >= (3, 10): 146s func_code = concrete.consts[2] 146s names = ["int", "foo"] 146s consts = ["x", "y", func_code, "foo", None] 146s const_offset = 1 146s name_offset = 1 146s first_instrs = [ 146s ConcreteInstr("LOAD_CONST", 0, lineno=1), 146s ConcreteInstr("LOAD_NAME", 0, lineno=1), 146s ConcreteInstr("LOAD_CONST", 1, lineno=1), 146s ConcreteInstr("LOAD_NAME", 0, lineno=1), 146s ConcreteInstr("BUILD_TUPLE", 4, lineno=1), 146s ] 146s elif ( 146s sys.version_info >= (3, 7) 146s and concrete.flags & CompilerFlags.FUTURE_ANNOTATIONS 146s ): 146s func_code = concrete.consts[2] 146s names = ["foo"] 146s consts = ["int", ("x", "y"), func_code, "foo", None] 146s const_offset = 1 146s name_offset = 0 146s first_instrs = [ 146s ConcreteInstr("LOAD_CONST", 0, lineno=1), 146s ConcreteInstr("LOAD_CONST", 0, lineno=1), 146s ConcreteInstr("LOAD_CONST", 0 + const_offset, lineno=1), 146s ConcreteInstr("BUILD_CONST_KEY_MAP", 2, lineno=1), 146s ] 146s else: 146s func_code = concrete.consts[1] 146s names = ["int", "foo"] 146s consts = [("x", "y"), func_code, "foo", None] 146s const_offset = 0 146s name_offset = 1 146s first_instrs = [ 146s ConcreteInstr("LOAD_NAME", 0, lineno=1), 146s ConcreteInstr("LOAD_NAME", 0, lineno=1), 146s ConcreteInstr("LOAD_CONST", 0 + const_offset, lineno=1), 146s ConcreteInstr("BUILD_CONST_KEY_MAP", 2, lineno=1), 146s ] 146s 146s self.assertSequenceEqual(concrete.names, names) 146s self.assertSequenceEqual(concrete.consts, consts) 146s expected = ( 146s first_instrs 146s + [ 146s ConcreteInstr("LOAD_CONST", 1 + const_offset, lineno=1), 146s ConcreteInstr("LOAD_CONST", 2 + const_offset, lineno=1), 146s > ConcreteInstr("MAKE_FUNCTION", 4, lineno=1), 146s ConcreteInstr("STORE_NAME", name_offset, lineno=1), 146s ] 146s + ( 146s [ConcreteInstr("RETURN_CONST", 3 + const_offset, lineno=1)] 146s if sys.version_info >= (3, 12) 146s else [ 146s ConcreteInstr("LOAD_CONST", 3 + const_offset, lineno=1), 146s ConcreteInstr("RETURN_VALUE", lineno=1), 146s ] 146s ) 146s ) 146s 146s tests/test_concrete.py:816: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:99: in __init__ 146s super().__init__(name, arg, lineno=lineno, location=location, offset=offset) 146s /usr/lib/python3/dist-packages/bytecode/instr.py:537: in __init__ 146s self._set(name, arg) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:120: in _set 146s super()._set(name, arg) 146s /usr/lib/python3/dist-packages/bytecode/instr.py:747: in _set 146s self._check_arg(name, opcode, arg) 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = <[AttributeError("'bytecode.concrete.ConcreteInstr' object has no attribute '_arg'") raised in repr()] ConcreteInstr object at 0x3ffaf2b8280> 146s name = 'MAKE_FUNCTION', opcode = 26, arg = 4 146s 146s def _check_arg(self, name: str, opcode: int, arg: int) -> None: 146s if opcode_has_argument(opcode): 146s if arg is UNSET: 146s raise ValueError("operation %s requires an argument" % name) 146s 146s _check_arg_int(arg, name) 146s # opcode == 0 corresponds to CACHE instruction in 3.11+ and was unused before 146s elif opcode == 0: 146s arg = arg if arg is not UNSET else 0 146s _check_arg_int(arg, name) 146s else: 146s if arg is not UNSET: 146s > raise ValueError("operation %s has no argument" % name) 146s E ValueError: operation MAKE_FUNCTION has no argument 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:113: ValueError 146s _________________ ConcreteFromCodeTests.test_extended_arg_nop __________________ 146s 146s self = 146s 146s def test_extended_arg_nop(self): 146s constants = [None] * (0x000129 + 1) 146s constants[0x000129] = "Arbitrary String" 146s # EXTENDED_ARG 0x01, NOP 0xFF, EXTENDED_ARG 0x01, 146s # LOAD_CONST 0x29, RETURN_VALUE 0x00 146s codestring = bytes([0x90, 0x01, 0x09, 0xFF, 0x90, 0x01, 0x64, 0x29, 0x53, 0x00]) 146s codetype_list = [ 146s 0, 146s 0, 146s 0, 146s 1, 146s 64, 146s codestring, 146s tuple(constants), 146s (), 146s (), 146s "", 146s "code", 146s 1, 146s b"", 146s (), 146s (), 146s ] 146s if sys.version_info >= (3, 8): 146s codetype_list.insert(1, 0) 146s if sys.version_info >= (3, 11): 146s codetype_list.insert(12, "code") 146s codetype_list.insert(14, bytes()) 146s codetype_args = tuple(codetype_list) 146s code = types.CodeType(*codetype_args) 146s # Check it can be encoded and decoded 146s > codetype_output = Bytecode.from_code(code).to_code().co_consts 146s 146s tests/test_concrete.py:888: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 0 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ______________ ConcreteFromCodeTests.test_extended_arg_unpack_ex _______________ 146s 146s self = 146s 146s def test_extended_arg_unpack_ex(self): 146s def test(): 146s p = [1, 2, 3, 4, 5, 6] 146s q, r, *s, t = p 146s return q, r, s, t 146s 146s cpython_stacksize = test.__code__.co_stacksize 146s test.__code__ = ConcreteBytecode.from_code( 146s test.__code__, extended_arg=True 146s > ).to_code() 146s 146s tests/test_concrete.py:916: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ______________ ConcreteFromCodeTests.test_fail_extended_arg_jump _______________ 146s 146s self = 146s 146s def test_fail_extended_arg_jump(self): 146s def test(): 146s var = None 146s for _ in range(0, 1): 146s var = 0 146s var = 1 146s var = 2 146s var = 3 146s var = 4 146s var = 5 146s var = 6 146s var = 7 146s var = 8 146s var = 9 146s var = 10 146s var = 11 146s var = 12 146s var = 13 146s var = 14 146s var = 15 146s var = 16 146s var = 17 146s var = 18 146s var = 19 146s var = 20 146s var = 21 146s var = 22 146s var = 23 146s var = 24 146s var = 25 146s var = 26 146s var = 27 146s var = 28 146s var = 29 146s var = 30 146s var = 31 146s var = 32 146s var = 33 146s var = 34 146s var = 35 146s var = 36 146s var = 37 146s var = 38 146s var = 39 146s var = 40 146s var = 41 146s var = 42 146s var = 43 146s var = 44 146s var = 45 146s var = 46 146s var = 47 146s var = 48 146s var = 49 146s var = 50 146s var = 51 146s var = 52 146s var = 53 146s var = 54 146s var = 55 146s var = 56 146s var = 57 146s var = 58 146s var = 59 146s var = 60 146s var = 61 146s var = 62 146s var = 63 146s var = 64 146s var = 65 146s var = 66 146s var = 67 146s var = 68 146s var = 69 146s var = 70 146s return var 146s 146s # Generate the bytecode with extended arguments 146s bytecode = ConcreteBytecode.from_code(test.__code__, extended_arg=True) 146s > bytecode.to_code() 146s 146s tests/test_concrete.py:1270: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ___________________ ConcreteFromCodeTests.test_packing_lines ___________________ 146s 146s self = 146s 146s def test_packing_lines(self): 146s import dis 146s 146s from .long_lines_example import long_lines 146s 146s line_starts = list(dis.findlinestarts(long_lines.__code__)) 146s 146s concrete = ConcreteBytecode.from_code(long_lines.__code__) 146s > as_code = concrete.to_code() 146s 146s tests/test_concrete.py:1282: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ____________________ BytecodeToConcreteTests.test_cellvars _____________________ 146s 146s self = 146s 146s def test_cellvars(self): 146s code = Bytecode() 146s code.cellvars = ["x"] 146s code.freevars = ["y"] 146s code.extend( 146s [ 146s Instr("LOAD_DEREF", CellVar("x"), lineno=1), 146s Instr("LOAD_DEREF", FreeVar("y"), lineno=1), 146s ] 146s ) 146s > concrete = code.to_concrete_bytecode() 146s 146s tests/test_concrete.py:1604: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 84 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ____________ BytecodeToConcreteTests.test_compute_jumps_convergence ____________ 146s 146s self = 146s 146s def test_compute_jumps_convergence(self): 146s # Consider the following sequence of instructions: 146s # 146s # JUMP_FORWARD Label1 146s # JUMP_FORWARD Label2 146s # ...126 instructions... 146s # Label1: Offset 254 on first pass, 256 second pass 146s # NOP 146s # ... many more instructions ... 146s # Label2: Offset > 256 on first pass 146s # 146s # On first pass of compute_jumps(), Label2 will be at address 254, so 146s # that value encodes into the single byte arg of JUMP_ABSOLUTE. 146s # 146s # On second pass compute_jumps() the instr at Label1 will have offset 146s # of 256 so will also be given an EXTENDED_ARG. 146s # 146s # Thus we need to make an additional pass. This test only verifies 146s # case where 2 passes is insufficient but three is enough. 146s # 146s # On Python > 3.10 we need to double the number since the offset is now 146s # in term of instructions and not bytes. 146s 146s # Create code from comment above. 146s code = Bytecode() 146s label1 = Label() 146s label2 = Label() 146s nop = "NOP" 146s code.append(Instr("JUMP_FORWARD", label1)) 146s code.append(Instr("JUMP_FORWARD", label2)) 146s # range excludes the last point ... 146s for _ in range(4, 511 if OFFSET_AS_INSTRUCTION else 255, 2): 146s code.append(Instr(nop)) 146s code.append(label1) 146s code.append(Instr(nop)) 146s for _ in range( 146s 514 if OFFSET_AS_INSTRUCTION else 256, 146s 600 if OFFSET_AS_INSTRUCTION else 300, 146s 2, 146s ): 146s code.append(Instr(nop)) 146s code.append(label2) 146s code.append(Instr(nop)) 146s 146s # This should pass by default. 146s > code.to_code() 146s 146s tests/test_concrete.py:1653: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 146s bc = self.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 79 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ______________ BytecodeToConcreteTests.test_dont_merge_constants _______________ 146s 146s self = 146s 146s def test_dont_merge_constants(self): 146s # test two constants which are equal but have a different type 146s code = Bytecode() 146s code.extend( 146s [ 146s Instr("LOAD_CONST", 5, lineno=1), 146s Instr("LOAD_CONST", 5.0, lineno=1), 146s Instr("LOAD_CONST", -0.0, lineno=1), 146s Instr("LOAD_CONST", +0.0, lineno=1), 146s ] 146s ) 146s 146s > code = code.to_concrete_bytecode() 146s 146s tests/test_concrete.py:1584: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s __________________ BytecodeToConcreteTests.test_extended_jump __________________ 146s 146s self = 146s 146s def test_extended_jump(self): 146s NOP = bytes((opcode.opmap["NOP"], 0)) 146s 146s # code using jumps > 0xffff to test extended arg 146s nb_nop = 2**16 if OFFSET_AS_INSTRUCTION else 2**15 146s # The length of the jump is independent of the number of instruction 146s # per the above logic. 146s jump = 2**16 146s code = ConcreteBytecode( 146s [ConcreteInstr("JUMP_FORWARD", jump)] 146s + [ConcreteInstr("NOP")] * nb_nop 146s + [ 146s ConcreteInstr("LOAD_CONST", 0), 146s ConcreteInstr("RETURN_VALUE"), 146s ], 146s consts=(None,), 146s ) 146s 146s > code_obj = code.to_code() 146s 146s tests/test_concrete.py:1514: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 146s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 79 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ________ BytecodeToConcreteTests.test_extreme_compute_jumps_convergence ________ 146s 146s self = 146s 146s def test_extreme_compute_jumps_convergence(self): 146s """Test of compute_jumps() requiring absurd number of passes. 146s 146s NOTE: This test also serves to demonstrate that there is no worst 146s case: the number of passes can be unlimited (or, actually, limited by 146s the size of the provided code). 146s 146s This is an extension of test_compute_jumps_convergence. Instead of 146s two jumps, where the earlier gets extended after the latter, we 146s instead generate a series of many jumps. Each pass of compute_jumps() 146s extends one more instruction, which in turn causes the one behind it 146s to be extended on the next pass. 146s 146s """ 146s 146s # N: the number of unextended instructions that can be squeezed into a 146s # set of bytes adressable by the arg of an unextended instruction. 146s # The answer is "128", but here's how we arrive at it. 146s max_unextended_offset = 1 << 8 146s unextended_branch_instr_size = 2 146s N = max_unextended_offset // unextended_branch_instr_size 146s 146s # When using instruction rather than bytes in the offset multiply by 2 146s if OFFSET_AS_INSTRUCTION: 146s N *= 2 146s 146s nop = "UNARY_NEGATIVE" # don't use NOP, dis.stack_effect will raise 146s 146s # The number of jumps will be equal to the number of labels. The 146s # number of passes of compute_jumps() required will be one greater 146s # than this. 146s labels = [Label() for x in range(0, 3 * N)] 146s 146s code = Bytecode() 146s code.extend( 146s Instr("JUMP_FORWARD", labels[len(labels) - x - 1]) 146s for x in range(0, len(labels)) 146s ) 146s end_of_jumps = len(code) 146s code.extend(Instr(nop) for x in range(0, N)) 146s 146s # Now insert the labels. The first is N instructions (i.e. 256 146s # bytes) after the last jump. Then they proceed to earlier positions 146s # 4 bytes at a time. While the targets are in the range of the nop 146s # instructions, 4 bytes is two instructions. When the targets are in 146s # the range of JUMP_FORWARD instructions we have to allow for the fact 146s # that the instructions will have been extended to four bytes each, so 146s # working backwards 4 bytes per label means just one instruction per 146s # label. 146s offset = end_of_jumps + N 146s for index in range(0, len(labels)): 146s code.insert(offset, labels[index]) 146s if offset <= end_of_jumps: 146s offset -= 1 146s else: 146s offset -= 2 146s 146s code.insert(0, Instr("LOAD_CONST", 0)) 146s del end_of_jumps 146s code.append(Instr("RETURN_VALUE")) 146s 146s > code.to_code(compute_jumps_passes=(len(labels) + 1)) 146s 146s tests/test_concrete.py:1720: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 146s bc = self.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ________________ BytecodeToConcreteTests.test_general_constants ________________ 146s 146s self = 146s 146s def test_general_constants(self): 146s """Test if general object could be linked as constants.""" 146s 146s class CustomObject: 146s pass 146s 146s class UnHashableCustomObject: 146s __hash__ = None 146s 146s obj1 = [1, 2, 3] 146s obj2 = {1, 2, 3} 146s obj3 = CustomObject() 146s obj4 = UnHashableCustomObject() 146s code = Bytecode( 146s [ 146s Instr("LOAD_CONST", obj1, lineno=1), 146s Instr("LOAD_CONST", obj2, lineno=1), 146s Instr("LOAD_CONST", obj3, lineno=1), 146s Instr("LOAD_CONST", obj4, lineno=1), 146s Instr("BUILD_TUPLE", 4, lineno=1), 146s Instr("RETURN_VALUE", lineno=1), 146s ] 146s ) 146s > self.assertEqual(code.to_code().co_consts, (obj1, obj2, obj3, obj4)) 146s 146s tests/test_concrete.py:1745: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 146s bc = self.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ______________________ BytecodeToConcreteTests.test_jumps ______________________ 146s 146s self = 146s 146s def test_jumps(self): 146s # if test: 146s # x = 12 146s # else: 146s # x = 37 146s code = Bytecode() 146s label_else = Label() 146s label_return = Label() 146s code.extend( 146s [ 146s Instr("LOAD_NAME", "test", lineno=1), 146s Instr( 146s "POP_JUMP_FORWARD_IF_FALSE" 146s if (3, 12) > sys.version_info >= (3, 11) 146s else "POP_JUMP_IF_FALSE", 146s label_else, 146s ), 146s Instr("LOAD_CONST", 12, lineno=2), 146s Instr("STORE_NAME", "x"), 146s Instr("JUMP_FORWARD", label_return), 146s label_else, 146s Instr("LOAD_CONST", 37, lineno=4), 146s Instr("STORE_NAME", "x"), 146s label_return, 146s Instr("LOAD_CONST", None, lineno=4), 146s Instr("RETURN_VALUE"), 146s ] 146s ) 146s 146s > code = code.to_concrete_bytecode() 146s 146s tests/test_concrete.py:1549: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 92 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ______________________ BytecodeToConcreteTests.test_label ______________________ 146s 146s self = 146s 146s def test_label(self): 146s code = Bytecode() 146s label = Label() 146s code.extend( 146s [ 146s Instr("LOAD_CONST", "hello", lineno=1), 146s Instr("JUMP_FORWARD", label, lineno=1), 146s label, 146s Instr("POP_TOP", lineno=1), 146s ] 146s ) 146s 146s > code = code.to_concrete_bytecode() 146s 146s tests/test_concrete.py:1341: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _____________________ BytecodeToConcreteTests.test_label2 ______________________ 146s 146s self = 146s 146s def test_label2(self): 146s bytecode = Bytecode() 146s label = Label() 146s bytecode.extend( 146s [ 146s Instr("LOAD_NAME", "test", lineno=1), 146s Instr( 146s "POP_JUMP_FORWARD_IF_FALSE" 146s if (3, 12) > sys.version_info >= (3, 11) 146s else "POP_JUMP_IF_FALSE", 146s label, 146s ), 146s Instr("LOAD_CONST", 5, lineno=2), 146s Instr("STORE_NAME", "x"), 146s Instr("JUMP_FORWARD", label), 146s Instr("LOAD_CONST", 7, lineno=4), 146s Instr("STORE_NAME", "x"), 146s label, 146s Instr("LOAD_CONST", None), 146s Instr("RETURN_VALUE"), 146s ] 146s ) 146s 146s > concrete = bytecode.to_concrete_bytecode() 146s 146s tests/test_concrete.py:1373: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 92 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _____________________ BytecodeToConcreteTests.test_label3 ______________________ 146s 146s self = 146s 146s def test_label3(self): 146s """ 146s CPython generates useless EXTENDED_ARG 0 in some cases. We need to 146s properly track them as otherwise we can end up with broken offset for 146s jumps. 146s """ 146s source = """ 146s def func(x): 146s if x == 1: 146s return x + 0 146s elif x == 2: 146s return x + 1 146s elif x == 3: 146s return x + 2 146s elif x == 4: 146s return x + 3 146s elif x == 5: 146s return x + 4 146s elif x == 6: 146s return x + 5 146s elif x == 7: 146s return x + 6 146s elif x == 8: 146s return x + 7 146s elif x == 9: 146s return x + 8 146s elif x == 10: 146s return x + 9 146s elif x == 11: 146s return x + 10 146s elif x == 12: 146s return x + 11 146s elif x == 13: 146s return x + 12 146s elif x == 14: 146s return x + 13 146s elif x == 15: 146s return x + 14 146s elif x == 16: 146s return x + 15 146s elif x == 17: 146s return x + 16 146s return -1 146s """ 146s code = get_code(source, function=True) 146s > bcode = Bytecode.from_code(code) 146s 146s tests/test_concrete.py:1441: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ____________________ BytecodeToConcreteTests.test_setlineno ____________________ 146s 146s self = 146s 146s def test_setlineno(self): 146s # x = 7 146s # y = 8 146s # z = 9 146s concrete = ConcreteBytecode() 146s concrete.consts = [7, 8, 9] 146s concrete.names = ["x", "y", "z"] 146s concrete.first_lineno = 3 146s concrete.extend( 146s [ 146s ConcreteInstr("LOAD_CONST", 0), 146s ConcreteInstr("STORE_NAME", 0), 146s SetLineno(4), 146s ConcreteInstr("LOAD_CONST", 1), 146s ConcreteInstr("STORE_NAME", 1), 146s SetLineno(5), 146s ConcreteInstr("LOAD_CONST", 2), 146s ConcreteInstr("STORE_NAME", 2), 146s ] 146s ) 146s 146s > code = concrete.to_bytecode() 146s 146s tests/test_concrete.py:1483: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 83 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _____________________________ InstrTests.test_attr _____________________________ 146s 146s self = 146s 146s def test_attr(self): 146s instr = Instr("LOAD_CONST", 3, lineno=5) 146s self.assertEqual(instr.name, "LOAD_CONST") 146s > self.assertEqual(instr.opcode, 100) 146s E AssertionError: 83 != 100 146s 146s tests/test_instr.py:232: AssertionError 146s _____________ InstrTests.test_code_object_containing_mutable_data ______________ 146s 146s self = 146s 146s def test_code_object_containing_mutable_data(self): 146s from types import CodeType 146s 146s from bytecode import Bytecode, Instr 146s 146s def f(): 146s def g(): 146s # Under Python 3.12+ we need a temporary var to be sure we use 146s # LOAD_CONST rather than RETURN_CONST 146s a = "value" 146s return a 146s 146s return g 146s 146s > f_code = Bytecode.from_code(f.__code__) 146s 146s tests/test_instr.py:434: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ________________________ CompareTests.test_compare_ops _________________________ 146s 146s self = 146s 146s def test_compare_ops(self): 146s from bytecode import Bytecode, Instr 146s 146s def f(): 146s pass 146s 146s params = zip(iter(Compare), (True, True, False, True, False, False)) 146s for cmp, expected in params: 146s with self.subTest(cmp): 146s bcode = Bytecode( 146s ([Instr("RESUME", 0)] if sys.version_info >= (3, 11) else []) 146s + [ 146s Instr("LOAD_CONST", 24), 146s Instr("LOAD_CONST", 42), 146s Instr("COMPARE_OP", cmp), 146s Instr("RETURN_VALUE"), 146s ] 146s ) 146s > f.__code__ = bcode.to_code() 146s 146s tests/test_instr.py:479: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 146s bc = self.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 146s return converter.to_concrete_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 146s self.concrete_instructions() 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 146s self.required_caches = c_instr.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _________________________ DumpCodeTests.test_bytecode __________________________ 146s 146s self = 146s 146s def test_bytecode(self): 146s source = """ 146s def func(test): 146s if test == 1: 146s return 1 146s elif test == 2: 146s return 2 146s return 3 146s """ 146s > code = disassemble(source, function=True) 146s 146s tests/test_misc.py:37: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/__init__.py:143: in disassemble 146s return Bytecode.from_code(code) 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s ______________________ DumpCodeTests.test_bytecode_blocks ______________________ 146s 146s self = 146s 146s def test_bytecode_blocks(self): 146s source = """ 146s def func(test): 146s if test == 1: 146s return 1 146s elif test == 2: 146s return 2 146s return 3 146s """ 146s > code = disassemble(source, function=True) 146s 146s tests/test_misc.py:206: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/__init__.py:143: in disassemble 146s return Bytecode.from_code(code) 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s _____________________ DumpCodeTests.test_concrete_bytecode _____________________ 146s 146s self = 146s 146s def test_concrete_bytecode(self): 146s source = """ 146s def func(test): 146s if test == 1: 146s return 1 146s elif test == 2: 146s return 2 146s return 3 146s """ 146s > code = disassemble(source, function=True) 146s 146s tests/test_misc.py:409: 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s tests/__init__.py:143: in disassemble 146s return Bytecode.from_code(code) 146s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 146s return concrete.to_bytecode( 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 146s target = c_instr.get_jump_target(offset) 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 146s ) + self.use_cache_opcodes() 146s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 146s 146s self = 146s 146s def use_cache_opcodes(self) -> int: 146s return ( 146s # Not supposed to be used but we need it 146s > dis._inline_cache_entries[self._opcode] # type: ignore 146s if sys.version_info >= (3, 11) 146s else 0 146s ) 146s E KeyError: 149 146s 146s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 146s =========================== short test summary info ============================ 146s FAILED tests/test_bytecode.py::BytecodeTests::test_cellvar_freevar_roundtrip 146s FAILED tests/test_bytecode.py::BytecodeTests::test_eq - KeyError: 149 146s FAILED tests/test_bytecode.py::BytecodeTests::test_eq_with_try - KeyError: 149 146s FAILED tests/test_bytecode.py::BytecodeTests::test_exception_table_round_trip 146s FAILED tests/test_bytecode.py::BytecodeTests::test_from_code - KeyError: 149 146s FAILED tests/test_bytecode.py::BytecodeTests::test_from_code_freevars - KeyEr... 146s FAILED tests/test_bytecode.py::BytecodeTests::test_from_code_load_fast - KeyE... 146s FAILED tests/test_bytecode.py::BytecodeTests::test_negative_size_binary_with_disable_check_of_pre_and_post 146s FAILED tests/test_bytecode.py::BytecodeTests::test_negative_size_build_const_map_with_disable_check_of_pre_and_post 146s FAILED tests/test_bytecode.py::BytecodeTests::test_negative_size_build_map_with_disable_check_of_pre_and_post 146s FAILED tests/test_bytecode.py::BytecodeTests::test_negative_size_unary_with_disable_check_of_pre_and_post 146s FAILED tests/test_bytecode.py::BytecodeTests::test_not_enough_copy_with_disable_check_of_pre_and_post 146s FAILED tests/test_bytecode.py::BytecodeTests::test_not_enough_swap_with_disable_check_of_pre_and_post 146s FAILED tests/test_bytecode.py::BytecodeTests::test_setlineno - KeyError: 83 146s FAILED tests/test_bytecode.py::BytecodeTests::test_to_code - KeyError: 92 146s FAILED tests/test_cfg.py::BytecodeBlocksTests::test_attr - KeyError: 149 146s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_eq - KeyError: 149 146s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_eq_with_try_except 146s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_split_block - K... 146s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_split_block_dont_split 146s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_split_block_end 146s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_split_block_error 146s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_to_code - KeyEr... 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_and 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_for_loop_continue 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_if_else 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_nested_try_except_else_finally 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_nested_try_except_finally 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_or 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_try_except 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_try_except_else_finally 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_try_except_finally 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_try_finally 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_while_loop_break 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_with 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_with_dead_code 146s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_with_dead_code2 146s FAILED tests/test_cfg.py::CFGRoundTripTests::test_cellvar_freevar_roundtrip 146s FAILED tests/test_cfg.py::CFGRoundTripTests::test_roundtrip_exception_handling 146s FAILED tests/test_code.py::CodeTests::test_async_func - KeyError: 35 146s FAILED tests/test_code.py::CodeTests::test_generator_func - KeyError: 35 146s FAILED tests/test_code.py::CodeTests::test_kwargs - KeyError: 149 146s FAILED tests/test_code.py::CodeTests::test_kwonlyargs - KeyError: 149 146s FAILED tests/test_code.py::CodeTests::test_loop - KeyError: 149 146s FAILED tests/test_code.py::CodeTests::test_varargs - KeyError: 149 146s FAILED tests/test_concrete.py::ConcreteInstrTests::test_assemble - AssertionE... 146s FAILED tests/test_concrete.py::ConcreteInstrTests::test_attr - AssertionError... 146s FAILED tests/test_concrete.py::ConcreteInstrTests::test_disassemble - Asserti... 146s FAILED tests/test_concrete.py::ConcreteInstrTests::test_get_jump_target - Key... 146s FAILED tests/test_concrete.py::ConcreteInstrTests::test_set_attr - AssertionE... 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_cellvar - KeyError... 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_cellvar_freevar - ... 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_eq - KeyError: 83 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_explicit_stacksize 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_extended_lnotab - ... 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_extended_lnotab2 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_freevar - KeyError... 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_load_classderef - ... 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_negative_lnotab - ... 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_to_bytecode_consts 146s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_to_code_lnotab - K... 146s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_cellvar_freevar_roundtrip 146s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_exception_table_round_trip 146s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_expected_arg_with_many_consts 146s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_extended_arg_make_function 146s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_extended_arg_nop 146s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_extended_arg_unpack_ex 146s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_fail_extended_arg_jump 146s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_packing_lines - Ke... 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_cellvars - KeyEr... 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_compute_jumps_convergence 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_dont_merge_constants 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_extended_jump - ... 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_extreme_compute_jumps_convergence 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_general_constants 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_jumps - KeyError... 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_label - KeyError... 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_label2 - KeyErro... 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_label3 - KeyErro... 146s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_setlineno - KeyE... 146s FAILED tests/test_instr.py::InstrTests::test_attr - AssertionError: 83 != 100 146s FAILED tests/test_instr.py::InstrTests::test_code_object_containing_mutable_data 146s FAILED tests/test_instr.py::CompareTests::test_compare_ops - KeyError: 149 146s FAILED tests/test_misc.py::DumpCodeTests::test_bytecode - KeyError: 149 146s FAILED tests/test_misc.py::DumpCodeTests::test_bytecode_blocks - KeyError: 149 146s FAILED tests/test_misc.py::DumpCodeTests::test_concrete_bytecode - KeyError: 149 146s =================== 86 failed, 71 passed, 8 skipped in 5.58s =================== 146s autopkgtest [13:09:32]: test pytest: -----------------------] 146s autopkgtest [13:09:32]: test pytest: - - - - - - - - - - results - - - - - - - - - - 146s pytest FAIL non-zero exit status 1 147s autopkgtest [13:09:33]: @@@@@@@@@@@@@@@@@@@@ summary 147s pytest FAIL non-zero exit status 1 151s nova [W] Using flock in prodstack6-s390x 151s Creating nova instance adt-plucky-s390x-python-bytecode-20241113-130706-juju-7f2275-prod-proposed-migration-environment-20-ad167431-b663-411a-9972-3acba88c5239 from image adt/ubuntu-plucky-s390x-server-20241113.img (UUID e740277e-1f72-40ae-bfbe-46030537c71c)...