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