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