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