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