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