1s autopkgtest [20:36:04]: starting date and time: 2024-11-23 20:36:04+0000 1s autopkgtest [20:36:05]: git checkout: 6f3be7a8 Fix armhf LXD image generation for plucky 1s autopkgtest [20:36:05]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.jjzus1z8/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python3-defaults --apt-upgrade python-bytecode --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=python3-defaults/3.12.7-1 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest-s390x --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@bos03-s390x-1.secgroup --name adt-plucky-s390x-python-bytecode-20241123-203604-juju-7f2275-prod-proposed-migration-environment-15-0b12c6ef-f4ed-4b04-8c42-4570b58429fd --image adt/ubuntu-plucky-s390x-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration-s390x -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/ 110s autopkgtest [20:37:54]: testbed dpkg architecture: s390x 110s autopkgtest [20:37:54]: testbed apt version: 2.9.8 110s autopkgtest [20:37:54]: @@@@@@@@@@@@@@@@@@@@ test bed setup 111s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 112s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [54.8 kB] 112s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [930 kB] 112s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [9704 B] 112s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [13.6 kB] 112s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x Packages [70.6 kB] 112s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/restricted s390x Packages [756 B] 112s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/universe s390x Packages [760 kB] 112s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse s390x Packages [6452 B] 112s Fetched 1920 kB in 1s (1984 kB/s) 112s Reading package lists... 114s Reading package lists... 115s Building dependency tree... 115s Reading state information... 115s Calculating upgrade... 115s The following package was automatically installed and is no longer required: 115s libsgutils2-1.46-2 115s Use 'sudo apt autoremove' to remove it. 115s The following NEW packages will be installed: 115s libsgutils2-1.48 115s The following packages will be upgraded: 115s bash bpftrace curl debconf debconf-i18n distro-info gir1.2-girepository-2.0 115s gir1.2-glib-2.0 hostname libaudit-common libaudit1 libcurl3t64-gnutls 115s libcurl4t64 libgirepository-1.0-1 libglib2.0-0t64 libglib2.0-data 115s libpam-modules libpam-modules-bin libpam-runtime libpam0g libplymouth5 115s libpython3-stdlib libselinux1 libsemanage-common libsemanage2 linux-base 115s lxd-installer openssh-client openssh-server openssh-sftp-server plymouth 115s plymouth-theme-ubuntu-text python3 python3-blinker python3-debconf 115s python3-jsonschema-specifications python3-minimal python3-rpds-py 115s python3-yaml sg3-utils sg3-utils-udev vim-common vim-tiny xxd 115s 44 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 115s Need to get 11.4 MB of archives. 115s After this operation, 2418 kB of additional disk space will be used. 115s Get:1 http://ftpmaster.internal/ubuntu plucky/main s390x bash s390x 5.2.32-1ubuntu2 [845 kB] 115s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x hostname s390x 3.25 [11.2 kB] 115s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x libaudit-common all 1:4.0.2-2ubuntu1 [6578 B] 115s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x libaudit1 s390x 1:4.0.2-2ubuntu1 [52.5 kB] 115s Get:5 http://ftpmaster.internal/ubuntu plucky/main s390x debconf-i18n all 1.5.87ubuntu1 [204 kB] 115s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3-minimal s390x 3.12.7-1 [27.4 kB] 115s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3 s390x 3.12.7-1 [24.0 kB] 115s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x libpython3-stdlib s390x 3.12.7-1 [10.0 kB] 115s Get:9 http://ftpmaster.internal/ubuntu plucky/main s390x python3-debconf all 1.5.87ubuntu1 [4156 B] 115s Get:10 http://ftpmaster.internal/ubuntu plucky/main s390x debconf all 1.5.87ubuntu1 [124 kB] 116s Get:11 http://ftpmaster.internal/ubuntu plucky/main s390x libpam0g s390x 1.5.3-7ubuntu4 [70.0 kB] 116s Get:12 http://ftpmaster.internal/ubuntu plucky/main s390x libselinux1 s390x 3.7-3ubuntu1 [85.2 kB] 116s Get:13 http://ftpmaster.internal/ubuntu plucky/main s390x libpam-modules-bin s390x 1.5.3-7ubuntu4 [56.2 kB] 116s Get:14 http://ftpmaster.internal/ubuntu plucky/main s390x libpam-modules s390x 1.5.3-7ubuntu4 [294 kB] 116s Get:15 http://ftpmaster.internal/ubuntu plucky/main s390x openssh-sftp-server s390x 1:9.9p1-3ubuntu2 [38.2 kB] 116s Get:16 http://ftpmaster.internal/ubuntu plucky/main s390x openssh-server s390x 1:9.9p1-3ubuntu2 [552 kB] 116s Get:17 http://ftpmaster.internal/ubuntu plucky/main s390x openssh-client s390x 1:9.9p1-3ubuntu2 [955 kB] 116s Get:18 http://ftpmaster.internal/ubuntu plucky/main s390x libpam-runtime all 1.5.3-7ubuntu4 [40.8 kB] 116s Get:19 http://ftpmaster.internal/ubuntu plucky/main s390x libsemanage-common all 3.7-2build1 [7186 B] 116s Get:20 http://ftpmaster.internal/ubuntu plucky/main s390x libsemanage2 s390x 3.7-2build1 [97.1 kB] 116s Get:21 http://ftpmaster.internal/ubuntu plucky/main s390x distro-info s390x 1.12 [20.0 kB] 116s Get:22 http://ftpmaster.internal/ubuntu plucky/main s390x gir1.2-girepository-2.0 s390x 1.82.0-2 [25.0 kB] 116s Get:23 http://ftpmaster.internal/ubuntu plucky/main s390x gir1.2-glib-2.0 s390x 2.82.2-3 [180 kB] 116s Get:24 http://ftpmaster.internal/ubuntu plucky/main s390x libglib2.0-0t64 s390x 2.82.2-3 [1575 kB] 116s Get:25 http://ftpmaster.internal/ubuntu plucky/main s390x libgirepository-1.0-1 s390x 1.82.0-2 [84.9 kB] 116s Get:26 http://ftpmaster.internal/ubuntu plucky/main s390x libglib2.0-data all 2.82.2-3 [51.7 kB] 116s Get:27 http://ftpmaster.internal/ubuntu plucky/main s390x python3-yaml s390x 6.0.2-1build1 [188 kB] 116s Get:28 http://ftpmaster.internal/ubuntu plucky/main s390x vim-tiny s390x 2:9.1.0861-1ubuntu1 [664 kB] 116s Get:29 http://ftpmaster.internal/ubuntu plucky/main s390x vim-common all 2:9.1.0861-1ubuntu1 [395 kB] 116s Get:30 http://ftpmaster.internal/ubuntu plucky/main s390x xxd s390x 2:9.1.0861-1ubuntu1 [66.6 kB] 116s Get:31 http://ftpmaster.internal/ubuntu plucky/main s390x libplymouth5 s390x 24.004.60-2ubuntu3 [150 kB] 116s Get:32 http://ftpmaster.internal/ubuntu plucky/main s390x plymouth-theme-ubuntu-text s390x 24.004.60-2ubuntu3 [10.1 kB] 116s Get:33 http://ftpmaster.internal/ubuntu plucky/main s390x plymouth s390x 24.004.60-2ubuntu3 [144 kB] 116s Get:34 http://ftpmaster.internal/ubuntu plucky/main s390x bpftrace s390x 0.21.2-2ubuntu3 [1718 kB] 116s Get:35 http://ftpmaster.internal/ubuntu plucky/main s390x curl s390x 8.9.1-2ubuntu3 [241 kB] 116s Get:36 http://ftpmaster.internal/ubuntu plucky/main s390x libcurl4t64 s390x 8.9.1-2ubuntu3 [386 kB] 116s Get:37 http://ftpmaster.internal/ubuntu plucky/main s390x libcurl3t64-gnutls s390x 8.9.1-2ubuntu3 [379 kB] 116s Get:38 http://ftpmaster.internal/ubuntu plucky/main s390x libsgutils2-1.48 s390x 1.48-0ubuntu1 [120 kB] 116s Get:39 http://ftpmaster.internal/ubuntu plucky/main s390x linux-base all 4.10.1ubuntu1 [34.8 kB] 116s Get:40 http://ftpmaster.internal/ubuntu plucky/main s390x lxd-installer all 10 [5264 B] 116s Get:41 http://ftpmaster.internal/ubuntu plucky/main s390x python3-blinker all 1.9.0-1 [10.7 kB] 116s Get:42 http://ftpmaster.internal/ubuntu plucky/main s390x python3-rpds-py s390x 0.21.0-2ubuntu1 [368 kB] 116s Get:43 http://ftpmaster.internal/ubuntu plucky/main s390x python3-jsonschema-specifications all 2023.12.1-2 [9116 B] 116s Get:44 http://ftpmaster.internal/ubuntu plucky/main s390x sg3-utils s390x 1.48-0ubuntu1 [1027 kB] 116s Get:45 http://ftpmaster.internal/ubuntu plucky/main s390x sg3-utils-udev all 1.48-0ubuntu1 [6608 B] 116s Preconfiguring packages ... 116s Fetched 11.4 MB in 1s (9127 kB/s) 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../bash_5.2.32-1ubuntu2_s390x.deb ... 117s Unpacking bash (5.2.32-1ubuntu2) over (5.2.32-1ubuntu1) ... 117s Setting up bash (5.2.32-1ubuntu2) ... 117s update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../hostname_3.25_s390x.deb ... 117s Unpacking hostname (3.25) over (3.23+nmu2ubuntu2) ... 117s Setting up hostname (3.25) ... 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../libaudit-common_1%3a4.0.2-2ubuntu1_all.deb ... 117s Unpacking libaudit-common (1:4.0.2-2ubuntu1) over (1:4.0.1-1ubuntu2) ... 117s Setting up libaudit-common (1:4.0.2-2ubuntu1) ... 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../libaudit1_1%3a4.0.2-2ubuntu1_s390x.deb ... 117s Unpacking libaudit1:s390x (1:4.0.2-2ubuntu1) over (1:4.0.1-1ubuntu2) ... 117s Setting up libaudit1:s390x (1:4.0.2-2ubuntu1) ... 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../debconf-i18n_1.5.87ubuntu1_all.deb ... 117s Unpacking debconf-i18n (1.5.87ubuntu1) over (1.5.86ubuntu1) ... 117s Preparing to unpack .../python3-minimal_3.12.7-1_s390x.deb ... 117s Unpacking python3-minimal (3.12.7-1) over (3.12.6-0ubuntu1) ... 117s Setting up python3-minimal (3.12.7-1) ... 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../python3_3.12.7-1_s390x.deb ... 117s Unpacking python3 (3.12.7-1) over (3.12.6-0ubuntu1) ... 117s Preparing to unpack .../libpython3-stdlib_3.12.7-1_s390x.deb ... 117s Unpacking libpython3-stdlib:s390x (3.12.7-1) over (3.12.6-0ubuntu1) ... 117s Preparing to unpack .../python3-debconf_1.5.87ubuntu1_all.deb ... 117s Unpacking python3-debconf (1.5.87ubuntu1) over (1.5.86ubuntu1) ... 117s Preparing to unpack .../debconf_1.5.87ubuntu1_all.deb ... 117s Unpacking debconf (1.5.87ubuntu1) over (1.5.86ubuntu1) ... 117s Setting up debconf (1.5.87ubuntu1) ... 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../libpam0g_1.5.3-7ubuntu4_s390x.deb ... 117s Unpacking libpam0g:s390x (1.5.3-7ubuntu4) over (1.5.3-7ubuntu2) ... 117s Setting up libpam0g:s390x (1.5.3-7ubuntu4) ... 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../libselinux1_3.7-3ubuntu1_s390x.deb ... 117s Unpacking libselinux1:s390x (3.7-3ubuntu1) over (3.5-2ubuntu5) ... 117s Setting up libselinux1:s390x (3.7-3ubuntu1) ... 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../libpam-modules-bin_1.5.3-7ubuntu4_s390x.deb ... 117s Unpacking libpam-modules-bin (1.5.3-7ubuntu4) over (1.5.3-7ubuntu2) ... 117s Setting up libpam-modules-bin (1.5.3-7ubuntu4) ... 117s pam_namespace.service is a disabled or a static unit not running, not starting it. 117s (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 ... 55541 files and directories currently installed.) 117s Preparing to unpack .../libpam-modules_1.5.3-7ubuntu4_s390x.deb ... 118s Unpacking libpam-modules:s390x (1.5.3-7ubuntu4) over (1.5.3-7ubuntu2) ... 118s Setting up libpam-modules:s390x (1.5.3-7ubuntu4) ... 118s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55541 files and directories currently installed.) 118s Preparing to unpack .../openssh-sftp-server_1%3a9.9p1-3ubuntu2_s390x.deb ... 118s Unpacking openssh-sftp-server (1:9.9p1-3ubuntu2) over (1:9.7p1-7ubuntu5) ... 118s Preparing to unpack .../openssh-server_1%3a9.9p1-3ubuntu2_s390x.deb ... 118s Unpacking openssh-server (1:9.9p1-3ubuntu2) over (1:9.7p1-7ubuntu5) ... 118s Preparing to unpack .../openssh-client_1%3a9.9p1-3ubuntu2_s390x.deb ... 118s Unpacking openssh-client (1:9.9p1-3ubuntu2) over (1:9.7p1-7ubuntu5) ... 118s Preparing to unpack .../libpam-runtime_1.5.3-7ubuntu4_all.deb ... 118s Unpacking libpam-runtime (1.5.3-7ubuntu4) over (1.5.3-7ubuntu2) ... 118s Setting up libpam-runtime (1.5.3-7ubuntu4) ... 118s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55543 files and directories currently installed.) 118s Preparing to unpack .../libsemanage-common_3.7-2build1_all.deb ... 118s Unpacking libsemanage-common (3.7-2build1) over (3.5-1build6) ... 118s Setting up libsemanage-common (3.7-2build1) ... 118s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55542 files and directories currently installed.) 118s Preparing to unpack .../libsemanage2_3.7-2build1_s390x.deb ... 118s Unpacking libsemanage2:s390x (3.7-2build1) over (3.5-1build6) ... 118s Setting up libsemanage2:s390x (3.7-2build1) ... 118s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55542 files and directories currently installed.) 118s Preparing to unpack .../00-distro-info_1.12_s390x.deb ... 118s Unpacking distro-info (1.12) over (1.9) ... 118s Preparing to unpack .../01-gir1.2-girepository-2.0_1.82.0-2_s390x.deb ... 118s Unpacking gir1.2-girepository-2.0:s390x (1.82.0-2) over (1.80.1-4) ... 118s Preparing to unpack .../02-gir1.2-glib-2.0_2.82.2-3_s390x.deb ... 118s Unpacking gir1.2-glib-2.0:s390x (2.82.2-3) over (2.82.1-0ubuntu1) ... 118s Preparing to unpack .../03-libglib2.0-0t64_2.82.2-3_s390x.deb ... 118s Unpacking libglib2.0-0t64:s390x (2.82.2-3) over (2.82.1-0ubuntu1) ... 118s Preparing to unpack .../04-libgirepository-1.0-1_1.82.0-2_s390x.deb ... 118s Unpacking libgirepository-1.0-1:s390x (1.82.0-2) over (1.80.1-4) ... 118s Preparing to unpack .../05-libglib2.0-data_2.82.2-3_all.deb ... 118s Unpacking libglib2.0-data (2.82.2-3) over (2.82.1-0ubuntu1) ... 118s Preparing to unpack .../06-python3-yaml_6.0.2-1build1_s390x.deb ... 118s Unpacking python3-yaml (6.0.2-1build1) over (6.0.2-1) ... 118s Preparing to unpack .../07-vim-tiny_2%3a9.1.0861-1ubuntu1_s390x.deb ... 118s Unpacking vim-tiny (2:9.1.0861-1ubuntu1) over (2:9.1.0777-1ubuntu1) ... 118s Preparing to unpack .../08-vim-common_2%3a9.1.0861-1ubuntu1_all.deb ... 118s Unpacking vim-common (2:9.1.0861-1ubuntu1) over (2:9.1.0777-1ubuntu1) ... 118s Preparing to unpack .../09-xxd_2%3a9.1.0861-1ubuntu1_s390x.deb ... 118s Unpacking xxd (2:9.1.0861-1ubuntu1) over (2:9.1.0777-1ubuntu1) ... 118s Preparing to unpack .../10-libplymouth5_24.004.60-2ubuntu3_s390x.deb ... 118s Unpacking libplymouth5:s390x (24.004.60-2ubuntu3) over (24.004.60-1ubuntu11) ... 118s Preparing to unpack .../11-plymouth-theme-ubuntu-text_24.004.60-2ubuntu3_s390x.deb ... 118s Unpacking plymouth-theme-ubuntu-text (24.004.60-2ubuntu3) over (24.004.60-1ubuntu11) ... 118s Preparing to unpack .../12-plymouth_24.004.60-2ubuntu3_s390x.deb ... 118s Unpacking plymouth (24.004.60-2ubuntu3) over (24.004.60-1ubuntu11) ... 118s Preparing to unpack .../13-bpftrace_0.21.2-2ubuntu3_s390x.deb ... 118s Unpacking bpftrace (0.21.2-2ubuntu3) over (0.21.2-2ubuntu2) ... 118s Preparing to unpack .../14-curl_8.9.1-2ubuntu3_s390x.deb ... 118s Unpacking curl (8.9.1-2ubuntu3) over (8.9.1-2ubuntu2) ... 118s Preparing to unpack .../15-libcurl4t64_8.9.1-2ubuntu3_s390x.deb ... 118s Unpacking libcurl4t64:s390x (8.9.1-2ubuntu3) over (8.9.1-2ubuntu2) ... 118s Preparing to unpack .../16-libcurl3t64-gnutls_8.9.1-2ubuntu3_s390x.deb ... 118s Unpacking libcurl3t64-gnutls:s390x (8.9.1-2ubuntu3) over (8.9.1-2ubuntu2) ... 118s Selecting previously unselected package libsgutils2-1.48:s390x. 118s Preparing to unpack .../17-libsgutils2-1.48_1.48-0ubuntu1_s390x.deb ... 118s Unpacking libsgutils2-1.48:s390x (1.48-0ubuntu1) ... 118s Preparing to unpack .../18-linux-base_4.10.1ubuntu1_all.deb ... 118s Unpacking linux-base (4.10.1ubuntu1) over (4.5ubuntu9) ... 118s Preparing to unpack .../19-lxd-installer_10_all.deb ... 118s Unpacking lxd-installer (10) over (9) ... 118s Preparing to unpack .../20-python3-blinker_1.9.0-1_all.deb ... 118s Unpacking python3-blinker (1.9.0-1) over (1.8.2-1) ... 118s Preparing to unpack .../21-python3-rpds-py_0.21.0-2ubuntu1_s390x.deb ... 119s Unpacking python3-rpds-py (0.21.0-2ubuntu1) over (0.20.0-0ubuntu3) ... 119s Preparing to unpack .../22-python3-jsonschema-specifications_2023.12.1-2_all.deb ... 119s Unpacking python3-jsonschema-specifications (2023.12.1-2) over (2023.12.1-1ubuntu1) ... 119s Preparing to unpack .../23-sg3-utils_1.48-0ubuntu1_s390x.deb ... 119s Unpacking sg3-utils (1.48-0ubuntu1) over (1.46-3ubuntu5) ... 119s Preparing to unpack .../24-sg3-utils-udev_1.48-0ubuntu1_all.deb ... 119s Unpacking sg3-utils-udev (1.48-0ubuntu1) over (1.46-3ubuntu5) ... 119s Setting up distro-info (1.12) ... 119s Setting up linux-base (4.10.1ubuntu1) ... 119s Setting up libcurl4t64:s390x (8.9.1-2ubuntu3) ... 119s Setting up bpftrace (0.21.2-2ubuntu3) ... 119s Setting up openssh-client (1:9.9p1-3ubuntu2) ... 119s Setting up libcurl3t64-gnutls:s390x (8.9.1-2ubuntu3) ... 119s Setting up libsgutils2-1.48:s390x (1.48-0ubuntu1) ... 119s Setting up debconf-i18n (1.5.87ubuntu1) ... 119s Setting up xxd (2:9.1.0861-1ubuntu1) ... 119s Setting up libglib2.0-0t64:s390x (2.82.2-3) ... 119s No schema files found: doing nothing. 119s Setting up libglib2.0-data (2.82.2-3) ... 119s Setting up vim-common (2:9.1.0861-1ubuntu1) ... 119s Setting up gir1.2-glib-2.0:s390x (2.82.2-3) ... 119s Setting up lxd-installer (10) ... 119s Setting up libplymouth5:s390x (24.004.60-2ubuntu3) ... 119s Setting up libgirepository-1.0-1:s390x (1.82.0-2) ... 119s Setting up curl (8.9.1-2ubuntu3) ... 119s Setting up libpython3-stdlib:s390x (3.12.7-1) ... 119s Setting up sg3-utils (1.48-0ubuntu1) ... 119s Setting up openssh-sftp-server (1:9.9p1-3ubuntu2) ... 119s Setting up openssh-server (1:9.9p1-3ubuntu2) ... 119s Installing new version of config file /etc/ssh/moduli ... 119s Replacing config file /etc/ssh/sshd_config with new version 120s Setting up plymouth (24.004.60-2ubuntu3) ... 120s update-initramfs: Generating /boot/initrd.img-6.11.0-8-generic 120s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 122s Using config file '/etc/zipl.conf' 122s Building bootmap in '/boot' 122s Adding IPL section 'ubuntu' (default) 122s Preparing boot device for LD-IPL: vda (0000). 122s Done. 122s update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults 122s update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults 122s Setting up python3 (3.12.7-1) ... 122s Setting up vim-tiny (2:9.1.0861-1ubuntu1) ... 122s Setting up sg3-utils-udev (1.48-0ubuntu1) ... 122s update-initramfs: deferring update (trigger activated) 122s Setting up plymouth-theme-ubuntu-text (24.004.60-2ubuntu3) ... 122s update-initramfs: deferring update (trigger activated) 122s Setting up gir1.2-girepository-2.0:s390x (1.82.0-2) ... 122s Setting up python3-rpds-py (0.21.0-2ubuntu1) ... 123s Setting up python3-jsonschema-specifications (2023.12.1-2) ... 123s Setting up python3-blinker (1.9.0-1) ... 123s Setting up python3-debconf (1.5.87ubuntu1) ... 123s Setting up python3-yaml (6.0.2-1build1) ... 123s Processing triggers for man-db (2.13.0-1) ... 124s Processing triggers for debianutils (5.21) ... 124s Processing triggers for install-info (7.1.1-1) ... 124s Processing triggers for initramfs-tools (0.142ubuntu35) ... 124s update-initramfs: Generating /boot/initrd.img-6.11.0-8-generic 124s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 126s Using config file '/etc/zipl.conf' 126s Building bootmap in '/boot' 126s Adding IPL section 'ubuntu' (default) 126s Preparing boot device for LD-IPL: vda (0000). 126s Done. 126s Processing triggers for libc-bin (2.40-1ubuntu3) ... 126s Processing triggers for ufw (0.36.2-8) ... 126s Reading package lists... 126s Building dependency tree... 126s Reading state information... 126s The following packages will be REMOVED: 126s libsgutils2-1.46-2* 126s 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 126s After this operation, 294 kB disk space will be freed. 126s (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 ... 55573 files and directories currently installed.) 126s Removing libsgutils2-1.46-2:s390x (1.46-3ubuntu5) ... 126s Processing triggers for libc-bin (2.40-1ubuntu3) ... 127s Hit:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease 127s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 127s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 127s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 128s Reading package lists... 128s Reading package lists... 128s Building dependency tree... 128s Reading state information... 128s Calculating upgrade... 128s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 128s Reading package lists... 128s Building dependency tree... 128s Reading state information... 128s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 129s autopkgtest [20:38:13]: rebooting testbed after setup commands that affected boot 132s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 149s autopkgtest [20:38:33]: testbed running kernel: Linux 6.11.0-8-generic #8-Ubuntu SMP Mon Sep 16 12:49:35 UTC 2024 151s autopkgtest [20:38:35]: @@@@@@@@@@@@@@@@@@@@ apt-source python-bytecode 154s Get:1 http://ftpmaster.internal/ubuntu plucky/universe python-bytecode 0.15.1-3 (dsc) [2738 B] 154s Get:2 http://ftpmaster.internal/ubuntu plucky/universe python-bytecode 0.15.1-3 (tar) [93.8 kB] 154s Get:3 http://ftpmaster.internal/ubuntu plucky/universe python-bytecode 0.15.1-3 (diff) [9036 B] 154s gpgv: Signature made Wed Dec 27 19:06:00 2023 UTC 154s gpgv: using RSA key 7E1AC3FA27A649284C323EF6695C429316C07BFE 154s gpgv: issuer "jdg@debian.org" 154s gpgv: Can't check signature: No public key 154s dpkg-source: warning: cannot verify inline signature for ./python-bytecode_0.15.1-3.dsc: no acceptable signature found 154s autopkgtest [20:38:38]: testing package python-bytecode version 0.15.1-3 154s autopkgtest [20:38:38]: build not needed 155s autopkgtest [20:38:39]: test pytest: preparing testbed 158s Reading package lists... 158s Building dependency tree... 158s Reading state information... 158s Starting pkgProblemResolver with broken count: 0 158s Starting 2 pkgProblemResolver with broken count: 0 158s Done 159s The following additional packages will be installed: 159s fonts-font-awesome fonts-lato libjs-jquery libjs-sphinxdoc libjs-underscore 159s libpython3.13-minimal libpython3.13-stdlib python-bytecode-doc python3-all 159s python3-bytecode python3-iniconfig python3-packaging python3-pluggy 159s python3-pytest python3.13 python3.13-minimal sphinx-rtd-theme-common 159s Suggested packages: 159s python3.13-venv python3.13-doc binfmt-support 159s Recommended packages: 159s javascript-common 159s The following NEW packages will be installed: 159s autopkgtest-satdep fonts-font-awesome fonts-lato libjs-jquery 159s libjs-sphinxdoc libjs-underscore libpython3.13-minimal libpython3.13-stdlib 159s python-bytecode-doc python3-all python3-bytecode python3-iniconfig 159s python3-packaging python3-pluggy python3-pytest python3.13 159s python3.13-minimal sphinx-rtd-theme-common 159s 0 upgraded, 18 newly installed, 0 to remove and 0 not upgraded. 159s Need to get 11.2 MB/11.2 MB of archives. 159s After this operation, 40.6 MB of additional disk space will be used. 159s Get:1 /tmp/autopkgtest.8deJ5g/1-autopkgtest-satdep.deb autopkgtest-satdep s390x 0 [732 B] 159s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x fonts-lato all 2.015-1 [2781 kB] 159s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x libpython3.13-minimal s390x 3.13.0-2 [877 kB] 159s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x python3.13-minimal s390x 3.13.0-2 [2172 kB] 159s Get:5 http://ftpmaster.internal/ubuntu plucky/main s390x fonts-font-awesome all 5.0.10+really4.7.0~dfsg-4.1 [516 kB] 159s Get:6 http://ftpmaster.internal/ubuntu plucky/main s390x libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 159s Get:7 http://ftpmaster.internal/ubuntu plucky/main s390x libjs-underscore all 1.13.4~dfsg+~1.11.4-3 [118 kB] 159s Get:8 http://ftpmaster.internal/ubuntu plucky/main s390x libjs-sphinxdoc all 7.4.7-4 [158 kB] 159s Get:9 http://ftpmaster.internal/ubuntu plucky/main s390x libpython3.13-stdlib s390x 3.13.0-2 [2086 kB] 160s Get:10 http://ftpmaster.internal/ubuntu plucky/main s390x sphinx-rtd-theme-common all 3.0.2+dfsg-1 [1014 kB] 160s Get:11 http://ftpmaster.internal/ubuntu plucky/universe s390x python-bytecode-doc all 0.15.1-3 [64.6 kB] 160s Get:12 http://ftpmaster.internal/ubuntu plucky/main s390x python3.13 s390x 3.13.0-2 [719 kB] 160s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3-all s390x 3.12.7-1 [890 B] 160s Get:14 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-bytecode all 0.15.1-3 [44.7 kB] 160s Get:15 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-iniconfig all 1.1.1-2 [6024 B] 160s Get:16 http://ftpmaster.internal/ubuntu plucky/main s390x python3-packaging all 24.2-1 [51.5 kB] 160s Get:17 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pluggy all 1.5.0-1 [21.0 kB] 160s Get:18 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pytest all 8.3.3-1 [251 kB] 160s Fetched 11.2 MB in 1s (11.1 MB/s) 160s Selecting previously unselected package fonts-lato. 160s (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 ... 55568 files and directories currently installed.) 160s Preparing to unpack .../00-fonts-lato_2.015-1_all.deb ... 160s Unpacking fonts-lato (2.015-1) ... 160s Selecting previously unselected package libpython3.13-minimal:s390x. 160s Preparing to unpack .../01-libpython3.13-minimal_3.13.0-2_s390x.deb ... 160s Unpacking libpython3.13-minimal:s390x (3.13.0-2) ... 160s Selecting previously unselected package python3.13-minimal. 160s Preparing to unpack .../02-python3.13-minimal_3.13.0-2_s390x.deb ... 160s Unpacking python3.13-minimal (3.13.0-2) ... 160s Selecting previously unselected package fonts-font-awesome. 160s Preparing to unpack .../03-fonts-font-awesome_5.0.10+really4.7.0~dfsg-4.1_all.deb ... 160s Unpacking fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 160s Selecting previously unselected package libjs-jquery. 160s Preparing to unpack .../04-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 160s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 160s Selecting previously unselected package libjs-underscore. 160s Preparing to unpack .../05-libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb ... 160s Unpacking libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 160s Selecting previously unselected package libjs-sphinxdoc. 160s Preparing to unpack .../06-libjs-sphinxdoc_7.4.7-4_all.deb ... 160s Unpacking libjs-sphinxdoc (7.4.7-4) ... 160s Selecting previously unselected package libpython3.13-stdlib:s390x. 160s Preparing to unpack .../07-libpython3.13-stdlib_3.13.0-2_s390x.deb ... 160s Unpacking libpython3.13-stdlib:s390x (3.13.0-2) ... 160s Selecting previously unselected package sphinx-rtd-theme-common. 160s Preparing to unpack .../08-sphinx-rtd-theme-common_3.0.2+dfsg-1_all.deb ... 160s Unpacking sphinx-rtd-theme-common (3.0.2+dfsg-1) ... 160s Selecting previously unselected package python-bytecode-doc. 160s Preparing to unpack .../09-python-bytecode-doc_0.15.1-3_all.deb ... 160s Unpacking python-bytecode-doc (0.15.1-3) ... 160s Selecting previously unselected package python3.13. 160s Preparing to unpack .../10-python3.13_3.13.0-2_s390x.deb ... 160s Unpacking python3.13 (3.13.0-2) ... 160s Selecting previously unselected package python3-all. 160s Preparing to unpack .../11-python3-all_3.12.7-1_s390x.deb ... 160s Unpacking python3-all (3.12.7-1) ... 160s Selecting previously unselected package python3-bytecode. 160s Preparing to unpack .../12-python3-bytecode_0.15.1-3_all.deb ... 160s Unpacking python3-bytecode (0.15.1-3) ... 160s Selecting previously unselected package python3-iniconfig. 160s Preparing to unpack .../13-python3-iniconfig_1.1.1-2_all.deb ... 160s Unpacking python3-iniconfig (1.1.1-2) ... 160s Selecting previously unselected package python3-packaging. 160s Preparing to unpack .../14-python3-packaging_24.2-1_all.deb ... 160s Unpacking python3-packaging (24.2-1) ... 160s Selecting previously unselected package python3-pluggy. 160s Preparing to unpack .../15-python3-pluggy_1.5.0-1_all.deb ... 160s Unpacking python3-pluggy (1.5.0-1) ... 160s Selecting previously unselected package python3-pytest. 160s Preparing to unpack .../16-python3-pytest_8.3.3-1_all.deb ... 160s Unpacking python3-pytest (8.3.3-1) ... 160s Selecting previously unselected package autopkgtest-satdep. 160s Preparing to unpack .../17-1-autopkgtest-satdep.deb ... 160s Unpacking autopkgtest-satdep (0) ... 160s Setting up python3-iniconfig (1.1.1-2) ... 161s Setting up fonts-lato (2.015-1) ... 161s Setting up libpython3.13-minimal:s390x (3.13.0-2) ... 161s Setting up python3-packaging (24.2-1) ... 161s Setting up python3-bytecode (0.15.1-3) ... 161s Setting up python3-pluggy (1.5.0-1) ... 161s Setting up python3.13-minimal (3.13.0-2) ... 162s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 162s Setting up libpython3.13-stdlib:s390x (3.13.0-2) ... 162s Setting up fonts-font-awesome (5.0.10+really4.7.0~dfsg-4.1) ... 162s Setting up sphinx-rtd-theme-common (3.0.2+dfsg-1) ... 162s Setting up libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... 162s Setting up python3.13 (3.13.0-2) ... 163s Setting up python3-pytest (8.3.3-1) ... 165s Setting up python3-all (3.12.7-1) ... 165s Setting up libjs-sphinxdoc (7.4.7-4) ... 165s Setting up python-bytecode-doc (0.15.1-3) ... 165s Setting up autopkgtest-satdep (0) ... 165s Processing triggers for man-db (2.13.0-1) ... 165s Processing triggers for systemd (256.5-2ubuntu4) ... 166s (Reading database ... 56707 files and directories currently installed.) 166s Removing autopkgtest-satdep (0) ... 166s autopkgtest [20:38:50]: test pytest: [----------------------- 167s Testing with python3.13: 167s ============================= test session starts ============================== 167s platform linux -- Python 3.13.0, pytest-8.3.3, pluggy-1.5.0 167s rootdir: /tmp/autopkgtest.8deJ5g/autopkgtest_tmp 167s plugins: typeguard-4.4.1 167s collected 165 items 167s 168s tests/test_bytecode.py F..sFFFsFFF...F..F.F..F..Fsss.FF.F [ 20%] 169s tests/test_cfg.py ....F.........FF.FFFFF....FFFFFFFFFFFFFFFF [ 46%] 169s tests/test_code.py FFFFFF [ 49%] 171s tests/test_concrete.py FF.FF.F..FF..F.FFFF..FF..FFFFFsFFFFFFFFFFFFFFFF [ 78%] 171s tests/test_flags.py ..ss.. [ 81%] 171s tests/test_instr.py ......FF...............F [ 96%] 171s tests/test_misc.py .FF.F. [100%] 171s 171s =================================== FAILURES =================================== 171s _________________ BytecodeTests.test_cellvar_freevar_roundtrip _________________ 171s 171s self = 171s 171s def test_cellvar_freevar_roundtrip(self): 171s from . import cell_free_vars_cases as cfc 171s 171s def recompile_code_and_inner(code): 171s bytecode = Bytecode.from_code( 171s code, 171s conserve_exception_block_stackdepth=True, 171s ) 171s for instr in bytecode: 171s if isinstance(instr, Instr) and isinstance(instr.arg, types.CodeType): 171s instr.arg = recompile_code_and_inner(instr.arg) 171s as_code = bytecode.to_code( 171s stacksize=code.co_stacksize, 171s compute_exception_stack_depths=False, 171s ) 171s self.assertCodeObjectEqual(code, as_code) 171s return as_code 171s 171s for f in cfc.TEST_CASES: 171s print(f.__name__) 171s with self.subTest(f.__name__): 171s origin = f.__code__ 171s > f.__code__ = recompile_code_and_inner(origin) 171s 171s tests/test_bytecode.py:711: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_bytecode.py:693: in recompile_code_and_inner 171s bytecode = Bytecode.from_code( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 94 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ----------------------------- Captured stdout call ----------------------------- 171s simple_cellvar 171s ____________________________ BytecodeTests.test_eq _____________________________ 171s 171s self = 171s 171s def test_eq(self): 171s code = get_code( 171s """ 171s if test: 171s x = 1 171s else: 171s x = 2 171s """ 171s ) 171s > b1 = Bytecode.from_code(code) 171s 171s tests/test_bytecode.py:139: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________________ BytecodeTests.test_eq_with_try ________________________ 171s 171s self = 171s 171s def test_eq_with_try(self): 171s code = get_code( 171s """ 171s try: 171s x = 1 171s except Exception: 171s pass 171s finally: 171s print() 171s """ 171s ) 171s > b1 = Bytecode.from_code(code) 171s 171s tests/test_bytecode.py:154: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________ BytecodeTests.test_exception_table_round_trip _________________ 171s 171s self = 171s 171s def test_exception_table_round_trip(self): 171s from . import exception_handling_cases as ehc 171s 171s for f in ehc.TEST_CASES: 171s print(f.__name__) 171s with self.subTest(f.__name__): 171s origin = f.__code__ 171s > bytecode = Bytecode.from_code( 171s origin, 171s conserve_exception_block_stackdepth=True, 171s ) 171s 171s tests/test_bytecode.py:673: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ----------------------------- Captured stdout call ----------------------------- 171s try_except_group 171s _________________________ BytecodeTests.test_from_code _________________________ 171s 171s self = 171s 171s def test_from_code(self): 171s code = get_code( 171s """ 171s if test: 171s x = 1 171s else: 171s x = 2 171s """ 171s ) 171s > bytecode = Bytecode.from_code(code) 171s 171s tests/test_bytecode.py:167: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________________ BytecodeTests.test_from_code_freevars _____________________ 171s 171s self = 171s 171s def test_from_code_freevars(self): 171s ns = {} 171s exec( 171s textwrap.dedent( 171s """ 171s def create_func(): 171s x = 1 171s def func(): 171s return x 171s return func 171s 171s func = create_func() 171s """ 171s ), 171s ns, 171s ns, 171s ) 171s code = ns["func"].__code__ 171s 171s > bytecode = Bytecode.from_code(code) 171s 171s tests/test_bytecode.py:259: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 62 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________________ BytecodeTests.test_from_code_load_fast ____________________ 171s 171s self = 171s 171s def test_from_code_load_fast(self): 171s code = get_code( 171s """ 171s def func(): 171s x = 33 171s y = x 171s """, 171s function=True, 171s ) 171s > code = Bytecode.from_code(code) 171s 171s tests/test_bytecode.py:285: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __ BytecodeTests.test_negative_size_binary_with_disable_check_of_pre_and_post __ 171s 171s self = 171s 171s def test_negative_size_binary_with_disable_check_of_pre_and_post(self): 171s operations = ( 171s "SUBSCR", # Subscr is special 171s "POWER", 171s "MULTIPLY", 171s "MATRIX_MULTIPLY", 171s "FLOOR_DIVIDE", 171s "TRUE_DIVIDE", 171s "ADD", 171s "SUBTRACT", 171s "LSHIFT", 171s "RSHIFT", 171s "AND", 171s "XOR", 171s "OR", 171s ) 171s if sys.version_info >= (3, 11): 171s operations += ("REMAINDER",) 171s else: 171s operations += ("MODULO",) 171s 171s for opname in operations: 171s ops = (opname,) 171s if opname != "SUBSCR": 171s ops += ("INPLACE_" + opname,) 171s for op in ops: 171s with self.subTest(op): 171s code = Bytecode() 171s code.first_lineno = 1 171s if sys.version_info >= (3, 11): 171s if op == "SUBSCR": 171s i = Instr("BINARY_SUBSCR") 171s else: 171s i = Instr("BINARY_OP", getattr(BinaryOp, op)) 171s else: 171s if "INPLACE" not in op: 171s op = "BINARY_" + op 171s i = Instr(op) 171s 171s code.extend([Instr("LOAD_CONST", 1), i]) 171s > co = code.to_code(check_pre_and_post=False) 171s 171s tests/test_bytecode.py:493: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _ BytecodeTests.test_negative_size_build_const_map_with_disable_check_of_pre_and_post _ 171s 171s self = 171s 171s def test_negative_size_build_const_map_with_disable_check_of_pre_and_post(self): 171s code = Bytecode() 171s code.first_lineno = 1 171s code.extend([Instr("LOAD_CONST", ("a",)), Instr("BUILD_CONST_KEY_MAP", 1)]) 171s > co = code.to_code(check_pre_and_post=False) 171s 171s tests/test_bytecode.py:559: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _ BytecodeTests.test_negative_size_build_map_with_disable_check_of_pre_and_post _ 171s 171s self = 171s 171s def test_negative_size_build_map_with_disable_check_of_pre_and_post(self): 171s code = Bytecode() 171s code.first_lineno = 1 171s code.extend([Instr("LOAD_CONST", 1), Instr("BUILD_MAP", 1)]) 171s > co = code.to_code(check_pre_and_post=False) 171s 171s tests/test_bytecode.py:545: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __ BytecodeTests.test_negative_size_unary_with_disable_check_of_pre_and_post ___ 171s 171s self = 171s 171s def test_negative_size_unary_with_disable_check_of_pre_and_post(self): 171s opnames = ( 171s "UNARY_POSITIVE", 171s "UNARY_NEGATIVE", 171s "UNARY_NOT", 171s "UNARY_INVERT", 171s ) 171s for opname in opnames: 171s # Replaced by an intrinsic in 3.12 171s if sys.version_info >= (3, 12) and opname == "UNARY_POSITIVE": 171s continue 171s with self.subTest(opname): 171s code = Bytecode() 171s code.first_lineno = 1 171s code.extend([Instr(opname)]) 171s > co = code.to_code(check_pre_and_post=False) 171s 171s tests/test_bytecode.py:407: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 42 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____ BytecodeTests.test_not_enough_copy_with_disable_check_of_pre_and_post _____ 171s 171s self = 171s 171s def test_not_enough_copy_with_disable_check_of_pre_and_post(self): 171s if sys.version_info < (3, 11): 171s self.skipTest("Instruction COPY does not exist before 3.11") 171s code = Bytecode() 171s code.first_lineno = 1 171s code.extend([Instr("LOAD_CONST", 1), Instr("COPY", 2)]) 171s > co = code.to_code(check_pre_and_post=False) 171s 171s tests/test_bytecode.py:619: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____ BytecodeTests.test_not_enough_swap_with_disable_check_of_pre_and_post _____ 171s 171s self = 171s 171s def test_not_enough_swap_with_disable_check_of_pre_and_post(self): 171s if sys.version_info < (3, 11): 171s self.skipTest("Instruction SWAP does not exist before 3.11") 171s code = Bytecode() 171s code.first_lineno = 1 171s code.extend([Instr("LOAD_CONST", 1), Instr("SWAP", 2)]) 171s > co = code.to_code(check_pre_and_post=False) 171s 171s tests/test_bytecode.py:637: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _________________________ BytecodeTests.test_setlineno _________________________ 171s 171s self = 171s 171s def test_setlineno(self): 171s # x = 7 171s # y = 8 171s # z = 9 171s code = Bytecode() 171s code.first_lineno = 3 171s code.extend( 171s [ 171s Instr("LOAD_CONST", 7), 171s Instr("STORE_NAME", "x"), 171s SetLineno(4), 171s Instr("LOAD_CONST", 8), 171s Instr("STORE_NAME", "y"), 171s SetLineno(5), 171s Instr("LOAD_CONST", 9), 171s Instr("STORE_NAME", "z"), 171s ] 171s ) 171s 171s > concrete = code.to_concrete_bytecode() 171s 171s tests/test_bytecode.py:330: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________________________ BytecodeTests.test_to_code __________________________ 171s 171s self = 171s 171s def test_to_code(self): 171s code = Bytecode() 171s code.first_lineno = 50 171s code.extend( 171s [ 171s Instr("LOAD_NAME", "print"), 171s Instr("LOAD_CONST", "%s"), 171s Instr( 171s "LOAD_GLOBAL", (False, "a") if sys.version_info >= (3, 11) else "a" 171s ), 171s Instr("BINARY_OP", BinaryOp.ADD) 171s if sys.version_info >= (3, 11) 171s else Instr("BINARY_ADD"), 171s ] 171s # For 3.12+ we need a NULL before a CALL to a free function 171s + ([Instr("PUSH_NULL")] if sys.version_info >= (3, 12) else []) 171s + [ 171s # On 3.11 we should have a pre-call 171s Instr("CALL" if sys.version_info >= (3, 11) else "CALL_FUNCTION", 1), 171s Instr("RETURN_VALUE"), 171s ] 171s ) 171s > co = code.to_code() 171s 171s tests/test_bytecode.py:367: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 92 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________________ BytecodeBlocksTests.test_attr _________________________ 171s 171s self = 171s 171s def test_attr(self): 171s source = """ 171s first_line = 1 171s 171s def func(arg1, arg2, *, arg3): 171s x = 1 171s y = 2 171s return arg1 171s """ 171s > code = disassemble(source, filename="hello.py", function=True) 171s 171s tests/test_cfg.py:133: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:30: in disassemble 171s code = _disassemble(source, filename=filename, function=function) 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________________ BytecodeBlocksFunctionalTests.test_eq _____________________ 171s 171s self = 171s 171s def test_eq(self): 171s # compare codes with multiple blocks and labels, 171s # Code.__eq__() renumbers labels to get equal labels 171s source = "x = 1 if test else 2" 171s > code1 = disassemble(source) 171s 171s tests/test_cfg.py:480: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:30: in disassemble 171s code = _disassemble(source, filename=filename, function=function) 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________ BytecodeBlocksFunctionalTests.test_eq_with_try_except _____________ 171s 171s self = 171s 171s def test_eq_with_try_except(self): 171s source = "try:\n x = 1\nexcept Exception:\n pass\nfinally:\n print()" 171s > code1 = disassemble(source) 171s 171s tests/test_cfg.py:499: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:30: in disassemble 171s code = _disassemble(source, filename=filename, function=function) 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________ BytecodeBlocksFunctionalTests.test_split_block ________________ 171s 171s self = 171s 171s def test_split_block(self): 171s > code = self.sample_code() 171s 171s tests/test_cfg.py:528: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:517: in sample_code 171s code = disassemble("x = 1", remove_last_return_none=True) 171s tests/test_cfg.py:30: in disassemble 171s code = _disassemble(source, filename=filename, function=function) 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________ BytecodeBlocksFunctionalTests.test_split_block_dont_split ___________ 171s 171s self = 171s 171s def test_split_block_dont_split(self): 171s > code = self.sample_code() 171s 171s tests/test_cfg.py:581: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:517: in sample_code 171s code = disassemble("x = 1", remove_last_return_none=True) 171s tests/test_cfg.py:30: in disassemble 171s code = _disassemble(source, filename=filename, function=function) 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ______________ BytecodeBlocksFunctionalTests.test_split_block_end ______________ 171s 171s self = 171s 171s def test_split_block_end(self): 171s > code = self.sample_code() 171s 171s tests/test_cfg.py:558: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:517: in sample_code 171s code = disassemble("x = 1", remove_last_return_none=True) 171s tests/test_cfg.py:30: in disassemble 171s code = _disassemble(source, filename=filename, function=function) 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____________ BytecodeBlocksFunctionalTests.test_split_block_error _____________ 171s 171s self = 171s 171s def test_split_block_error(self): 171s > code = self.sample_code() 171s 171s tests/test_cfg.py:591: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:517: in sample_code 171s code = disassemble("x = 1", remove_last_return_none=True) 171s tests/test_cfg.py:30: in disassemble 171s code = _disassemble(source, filename=filename, function=function) 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________________ BytecodeBlocksFunctionalTests.test_to_code __________________ 171s 171s self = 171s 171s def test_to_code(self): 171s # test resolution of jump labels 171s bytecode = ControlFlowGraph() 171s bytecode.first_lineno = 3 171s bytecode.argcount = 3 171s bytecode.posonlyargcount = 0 171s bytecode.kwonlyargcount = 2 171s bytecode.name = "func" 171s bytecode.filename = "hello.py" 171s bytecode.flags = 0x43 171s bytecode.argnames = ("arg", "arg2", "arg3", "kwonly", "kwonly2") 171s bytecode.docstring = None 171s block0 = bytecode[0] 171s block1 = bytecode.add_block() 171s block2 = bytecode.add_block() 171s block0.extend( 171s [ 171s Instr("LOAD_FAST", "x", lineno=4), 171s Instr( 171s "POP_JUMP_FORWARD_IF_FALSE" 171s if (3, 12) > sys.version_info >= (3, 11) 171s else "POP_JUMP_IF_FALSE", 171s block2, 171s lineno=4, 171s ), 171s ] 171s ) 171s block1.extend( 171s [Instr("LOAD_FAST", "arg", lineno=5), Instr("STORE_FAST", "x", lineno=5)] 171s ) 171s block2.extend( 171s [ 171s Instr("LOAD_CONST", 3, lineno=6), 171s Instr("STORE_FAST", "x", lineno=6), 171s Instr("LOAD_FAST", "x", lineno=7), 171s Instr("RETURN_VALUE", lineno=7), 171s ] 171s ) 171s 171s if sys.version_info >= (3, 11): 171s # jump is relative not absolute 171s expected = ( 171s b"|\x05" b"r\x02" b"|\x00" b"}\x05" b"d\x01" b"}\x05" b"|\x05" b"S\x00" 171s ) 171s elif OFFSET_AS_INSTRUCTION: 171s # The argument of the jump is divided by 2 171s expected = ( 171s b"|\x05" b"r\x04" b"|\x00" b"}\x05" b"d\x01" b"}\x05" b"|\x05" b"S\x00" 171s ) 171s else: 171s expected = ( 171s b"|\x05" b"r\x08" b"|\x00" b"}\x05" b"d\x01" b"}\x05" b"|\x05" b"S\x00" 171s ) 171s 171s > code = bytecode.to_code() 171s 171s tests/test_cfg.py:651: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/cfg.py:1057: in to_code 171s return bc.to_code( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 85 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _________ CFGStacksizeComputationTests.test_stack_size_computation_and _________ 171s 171s self = 171s 171s def test_stack_size_computation_and(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s return arg1 and args # Test JUMP_IF_FALSE_OR_POP 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:730: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __ CFGStacksizeComputationTests.test_stack_size_computation_for_loop_continue __ 171s 171s self = 171s 171s def test_stack_size_computation_for_loop_continue(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s for k in kwargs: 171s if k in args: 171s continue 171s else: 171s return 1 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:757: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _______ CFGStacksizeComputationTests.test_stack_size_computation_if_else _______ 171s 171s self = 171s 171s def test_stack_size_computation_if_else(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s if args: 171s return 0 171s elif kwargs: 171s return 1 171s else: 171s return 2 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:747: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _ CFGStacksizeComputationTests.test_stack_size_computation_nested_try_except_else_finally _ 171s 171s self = 171s 171s def test_stack_size_computation_nested_try_except_else_finally(self): 171s def test(*args, **kwargs): 171s try: 171s v = args[1] 171s except IndexError: 171s try: 171s w = kwargs["value"] 171s except KeyError: 171s return -1 171s else: 171s return w 171s finally: 171s print("second finally") 171s else: 171s return v 171s finally: 171s print("first finally") 171s 171s # A direct comparison of the stack depth fails because CPython 171s # generate dead code that is used in stack computation. 171s cpython_stacksize = test.__code__.co_stacksize 171s > test.__code__ = Bytecode.from_code(test.__code__).to_code() 171s 171s tests/test_cfg.py:856: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _ CFGStacksizeComputationTests.test_stack_size_computation_nested_try_except_finally _ 171s 171s self = 171s 171s def test_stack_size_computation_nested_try_except_finally(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s k = 1 171s try: 171s getattr(arg1, k) 171s except AttributeError: 171s pass 171s except Exception: 171s try: 171s assert False 171s except Exception: 171s return 2 171s finally: 171s print("unexpected") 171s finally: 171s print("attempted to get {}".format(k)) 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:833: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _________ CFGStacksizeComputationTests.test_stack_size_computation_or __________ 171s 171s self = 171s 171s def test_stack_size_computation_or(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s return arg1 or args # Test JUMP_IF_TRUE_OR_POP 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:736: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____ CFGStacksizeComputationTests.test_stack_size_computation_try_except ______ 171s 171s self = 171s 171s def test_stack_size_computation_try_except(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s try: 171s return args[0] 171s except Exception: 171s return 2 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:781: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _ CFGStacksizeComputationTests.test_stack_size_computation_try_except_else_finally _ 171s 171s self = 171s 171s def test_stack_size_computation_try_except_else_finally(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s try: 171s return args[0] 171s except Exception: 171s return 2 171s else: 171s return arg1 171s finally: 171s print("Interrupt") 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:814: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _ CFGStacksizeComputationTests.test_stack_size_computation_try_except_finally __ 171s 171s self = 171s 171s def test_stack_size_computation_try_except_finally(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s try: 171s return args[0] 171s except Exception: 171s return 2 171s finally: 171s print("Interrupt") 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:801: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____ CFGStacksizeComputationTests.test_stack_size_computation_try_finally _____ 171s 171s self = 171s 171s def test_stack_size_computation_try_finally(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s try: 171s return args[0] 171s finally: 171s return 2 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:790: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __ CFGStacksizeComputationTests.test_stack_size_computation_while_loop_break ___ 171s 171s self = 171s 171s def test_stack_size_computation_while_loop_break(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s while True: 171s if arg1: 171s break 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:765: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________ CFGStacksizeComputationTests.test_stack_size_computation_with _________ 171s 171s self = 171s 171s def test_stack_size_computation_with(self): 171s def test(arg1, *args, **kwargs): # pragma: no cover 171s with open(arg1) as f: 171s return f.read() 171s 171s > self.check_stack_size(test) 171s 171s tests/test_cfg.py:772: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:692: in check_stack_size 171s bytecode = Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _________ CFGStacksizeComputationTests.test_stack_size_with_dead_code __________ 171s 171s self = 171s 171s def test_stack_size_with_dead_code(self): 171s # Simply demonstrate more directly the previously mentioned issue. 171s def test(*args): # pragma: no cover 171s a = 0 171s return a 171s try: 171s a = args[0] 171s except IndexError: 171s return -1 171s else: 171s return a 171s 171s > test.__code__ = Bytecode.from_code(test.__code__).to_code() 171s 171s tests/test_cfg.py:882: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _________ CFGStacksizeComputationTests.test_stack_size_with_dead_code2 _________ 171s 171s self = 171s 171s def test_stack_size_with_dead_code2(self): 171s # See GH #118 171s source = """ 171s try: 171s pass 171s except Exception as e: 171s pass 171s """ 171s source = textwrap.dedent(source).strip() 171s code = compile(source, "", "exec") 171s > bytecode = Bytecode.from_code(code) 171s 171s tests/test_cfg.py:896: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _______________ CFGRoundTripTests.test_cellvar_freevar_roundtrip _______________ 171s 171s self = 171s 171s def test_cellvar_freevar_roundtrip(self): 171s from . import cell_free_vars_cases as cfc 171s 171s def recompile_code_and_inner(code): 171s cfg = ControlFlowGraph.from_bytecode(Bytecode.from_code(code)) 171s for block in cfg: 171s for instr in block: 171s if isinstance(instr.arg, types.CodeType): 171s instr.arg = recompile_code_and_inner(instr.arg) 171s as_code = cfg.to_code() 171s self.assertCodeObjectEqual(code, as_code) 171s return as_code 171s 171s for f in cfc.TEST_CASES: 171s print(f.__name__) 171s with self.subTest(f.__name__): 171s origin = f.__code__ 171s > f.__code__ = recompile_code_and_inner(origin) 171s 171s tests/test_cfg.py:980: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_cfg.py:967: in recompile_code_and_inner 171s cfg = ControlFlowGraph.from_bytecode(Bytecode.from_code(code)) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 94 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ----------------------------- Captured stdout call ----------------------------- 171s simple_cellvar 171s _____________ CFGRoundTripTests.test_roundtrip_exception_handling ______________ 171s 171s self = 171s 171s def test_roundtrip_exception_handling(self): 171s from . import exception_handling_cases as ehc 171s 171s for f in ehc.TEST_CASES: 171s # 3.12 use one less exception table entry causing to optimize this case 171s # less than we could otherwise 171s if sys.version_info >= (3, 12) and f.__name__ == "try_except_finally": 171s continue 171s print(f.__name__) 171s with self.subTest(f.__name__): 171s origin = f.__code__ 171s print("Bytecode:") 171s > bytecode = Bytecode.from_code( 171s f.__code__, conserve_exception_block_stackdepth=True 171s ) 171s 171s tests/test_cfg.py:947: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ----------------------------- Captured stdout call ----------------------------- 171s try_except_group 171s Bytecode: 171s __________________________ CodeTests.test_async_func ___________________________ 171s 171s self = 171s 171s def test_async_func(self): 171s > self.check( 171s """ 171s async def func(arg, arg2): 171s pass 171s """, 171s function=True, 171s ) 171s 171s tests/test_code.py:79: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_code.py:14: in check 171s code = ConcreteBytecode.from_code(ref_code).to_code() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 35 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________________ CodeTests.test_generator_func _________________________ 171s 171s self = 171s 171s def test_generator_func(self): 171s > self.check( 171s """ 171s def func(arg, arg2): 171s yield 171s """, 171s function=True, 171s ) 171s 171s tests/test_code.py:70: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_code.py:14: in check 171s code = ConcreteBytecode.from_code(ref_code).to_code() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 35 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________________________ CodeTests.test_kwargs _____________________________ 171s 171s self = 171s 171s def test_kwargs(self): 171s > self.check( 171s """ 171s def func(a, b, **kwargs): 171s pass 171s """, 171s function=True, 171s ) 171s 171s tests/test_code.py:50: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_code.py:14: in check 171s code = ConcreteBytecode.from_code(ref_code).to_code() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________________________ CodeTests.test_kwonlyargs ___________________________ 171s 171s self = 171s 171s def test_kwonlyargs(self): 171s > self.check( 171s """ 171s def func(*, arg, arg2): 171s pass 171s """, 171s function=True, 171s ) 171s 171s tests/test_code.py:59: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_code.py:14: in check 171s code = ConcreteBytecode.from_code(ref_code).to_code() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____________________________ CodeTests.test_loop ______________________________ 171s 171s self = 171s 171s def test_loop(self): 171s > self.check( 171s """ 171s for x in range(1, 10): 171s x += 1 171s if x == 3: 171s continue 171s x -= 1 171s if x > 7: 171s break 171s x = 0 171s print(x) 171s """ 171s ) 171s 171s tests/test_code.py:26: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_code.py:14: in check 171s code = ConcreteBytecode.from_code(ref_code).to_code() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________________________ CodeTests.test_varargs ____________________________ 171s 171s self = 171s 171s def test_varargs(self): 171s > self.check( 171s """ 171s def func(a, b, *varargs): 171s pass 171s """, 171s function=True, 171s ) 171s 171s tests/test_code.py:41: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_code.py:14: in check 171s code = ConcreteBytecode.from_code(ref_code).to_code() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _______________________ ConcreteInstrTests.test_assemble _______________________ 171s 171s self = 171s 171s def test_assemble(self): 171s instr = ConcreteInstr("NOP") 171s > self.assertEqual(instr.assemble(), b"\t\x00") 171s E AssertionError: b'\x1e\x00' != b'\t\x00' 171s 171s tests/test_concrete.py:146: AssertionError 171s _________________________ ConcreteInstrTests.test_attr _________________________ 171s 171s self = 171s 171s def test_attr(self): 171s instr = ConcreteInstr("LOAD_CONST", 5, lineno=12) 171s self.assertEqual(instr.name, "LOAD_CONST") 171s > self.assertEqual(instr.opcode, 100) 171s E AssertionError: 83 != 100 171s 171s tests/test_concrete.py:63: AssertionError 171s _____________________ ConcreteInstrTests.test_disassemble ______________________ 171s 171s self = 171s 171s def test_disassemble(self): 171s code = b"\t\x00d\x03" 171s instr = ConcreteInstr.disassemble(1, code, 0) 171s > self.assertEqual(instr, ConcreteInstr("NOP", lineno=1)) 171s E AssertionError: != 171s 171s tests/test_concrete.py:134: AssertionError 171s ___________________ ConcreteInstrTests.test_get_jump_target ____________________ 171s 171s self = 171s 171s def test_get_jump_target(self): 171s if sys.version_info < (3, 11): 171s jump_abs = ConcreteInstr("JUMP_ABSOLUTE", 3) 171s self.assertEqual(jump_abs.get_jump_target(100), 3) 171s 171s jump_forward = ConcreteInstr("JUMP_FORWARD", 5) 171s self.assertEqual( 171s > jump_forward.get_jump_target(10), 16 if OFFSET_AS_INSTRUCTION else 17 171s ) 171s 171s tests/test_concrete.py:170: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 79 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _______________________ ConcreteInstrTests.test_set_attr _______________________ 171s 171s self = 171s 171s def test_set_attr(self): 171s instr = ConcreteInstr("LOAD_CONST", 5, lineno=12) 171s 171s # operator name 171s instr.name = "LOAD_FAST" 171s self.assertEqual(instr.name, "LOAD_FAST") 171s > self.assertEqual(instr.opcode, 124) 171s E AssertionError: 85 != 124 171s 171s tests/test_concrete.py:93: AssertionError 171s ______________________ ConcreteBytecodeTests.test_cellvar ______________________ 171s 171s self = 171s 171s def test_cellvar(self): 171s concrete = ConcreteBytecode() 171s concrete.cellvars = ["x"] 171s concrete.append(ConcreteInstr("LOAD_DEREF", 0)) 171s > code = concrete.to_code() 171s 171s tests/test_concrete.py:469: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 84 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________________ ConcreteBytecodeTests.test_cellvar_freevar __________________ 171s 171s self = 171s 171s def test_cellvar_freevar(self): 171s concrete = ConcreteBytecode() 171s concrete.cellvars = ["cell"] 171s concrete.freevars = ["free"] 171s concrete.append(ConcreteInstr("LOAD_DEREF", 0)) 171s concrete.append(ConcreteInstr("LOAD_DEREF", 1)) 171s > code = concrete.to_code() 171s 171s tests/test_concrete.py:509: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 84 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________________ ConcreteBytecodeTests.test_eq _________________________ 171s 171s self = 171s 171s def test_eq(self): 171s code = ConcreteBytecode() 171s self.assertFalse(code == 1) 171s 171s for name, val in ( 171s ("names", ["a"]), 171s ("varnames", ["a"]), 171s ("consts", [1]), 171s ("argcount", 1), 171s ("kwonlyargcount", 2), 171s ("flags", CompilerFlags(CompilerFlags.GENERATOR)), 171s ("first_lineno", 10), 171s ("filename", "xxxx.py"), 171s ("name", "__x"), 171s ("docstring", "x-x-x"), 171s ("cellvars", [CellVar("x")]), 171s ("freevars", [FreeVar("x")]), 171s ): 171s c = ConcreteBytecode() 171s setattr(c, name, val) 171s # For obscure reasons using assertNotEqual here fail 171s self.assertFalse(code == c) 171s 171s c = ConcreteBytecode() 171s c.posonlyargcount = 10 171s self.assertFalse(code == c) 171s 171s c = ConcreteBytecode() 171s c.consts = [1] 171s code.consts = [1] 171s c.append(ConcreteInstr("LOAD_CONST", 0)) 171s > self.assertFalse(code == c) 171s 171s tests/test_concrete.py:225: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:320: in __eq__ 171s return super().__eq__(other) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:91: in __eq__ 171s if self.compute_stacksize() != other.compute_stacksize(): 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:846: in compute_stacksize 171s bytecode = self.to_bytecode() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________ ConcreteBytecodeTests.test_explicit_stacksize _________________ 171s 171s self = 171s 171s def test_explicit_stacksize(self): 171s # Passing stacksize=... to ConcreteBytecode.to_code should result in a 171s # code object with the specified stacksize. We pass some silly values 171s # and assert that they are honored. 171s code_obj = get_code("print('%s' % (a,b,c))") 171s original_stacksize = code_obj.co_stacksize 171s concrete = ConcreteBytecode.from_code(code_obj) 171s 171s # First with something bigger than necessary. 171s explicit_stacksize = original_stacksize + 42 171s new_code_obj = concrete.to_code( 171s stacksize=explicit_stacksize, compute_exception_stack_depths=False 171s ) 171s self.assertEqual(new_code_obj.co_stacksize, explicit_stacksize) 171s 171s # Then with something bogus. We probably don't want to advertise this 171s # in the documentation. If this fails then decide if it's for good 171s # reason, and remove if so. 171s explicit_stacksize = 0 171s new_code_obj = concrete.to_code( 171s stacksize=explicit_stacksize, compute_exception_stack_depths=False 171s ) 171s > self.assertEqual(new_code_obj.co_stacksize, explicit_stacksize) 171s E AssertionError: 1 != 0 171s 171s tests/test_concrete.py:614: AssertionError 171s __________________ ConcreteBytecodeTests.test_extended_lnotab __________________ 171s 171s self = 171s 171s def test_extended_lnotab(self): 171s # x = 7 171s # 200 blank lines 171s # y = 8 171s concrete = ConcreteBytecode( 171s [ 171s ConcreteInstr("LOAD_CONST", 0), 171s SetLineno(1 + 128), 171s ConcreteInstr("STORE_NAME", 0), 171s # line number goes backward! 171s SetLineno(1 + 129), 171s ConcreteInstr("LOAD_CONST", 1), 171s SetLineno(1), 171s ConcreteInstr("STORE_NAME", 1), 171s ] 171s ) 171s concrete.consts = [7, 8] 171s concrete.names = ["x", "y"] 171s concrete.first_lineno = 1 171s 171s > code = concrete.to_code() 171s 171s tests/test_concrete.py:365: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _________________ ConcreteBytecodeTests.test_extended_lnotab2 __________________ 171s 171s self = 171s 171s def test_extended_lnotab2(self): 171s # x = 7 171s # 200 blank lines 171s # y = 8 171s base_code = compile("x = 7" + "\n" * 200 + "y = 8", "", "exec") 171s concrete = ConcreteBytecode( 171s ( 171s [ConcreteInstr("RESUME", 0, lineno=0), SetLineno(1)] 171s if sys.version_info >= (3, 11) 171s else [] 171s ) 171s + [ 171s ConcreteInstr("LOAD_CONST", 0), 171s ConcreteInstr("STORE_NAME", 0), 171s SetLineno(201), 171s ConcreteInstr("LOAD_CONST", 1), 171s ConcreteInstr("STORE_NAME", 1), 171s ] 171s + ( 171s [ConcreteInstr("RETURN_CONST", 2)] 171s if sys.version_info >= (3, 12) 171s else [ 171s ConcreteInstr("LOAD_CONST", 2), 171s ConcreteInstr("RETURN_VALUE"), 171s ] 171s ) 171s ) 171s concrete.consts = [None, 7, 8] 171s concrete.names = ["x", "y"] 171s concrete.first_lineno = 1 171s 171s > code = concrete.to_code() 171s 171s tests/test_concrete.py:415: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ______________________ ConcreteBytecodeTests.test_freevar ______________________ 171s 171s self = 171s 171s def test_freevar(self): 171s concrete = ConcreteBytecode() 171s concrete.freevars = ["x"] 171s concrete.append(ConcreteInstr("LOAD_DEREF", 0)) 171s > code = concrete.to_code() 171s 171s tests/test_concrete.py:488: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 84 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________________ ConcreteBytecodeTests.test_load_classderef __________________ 171s 171s self = 171s 171s def test_load_classderef(self): 171s i_name = ( 171s "LOAD_FROM_DICT_OR_DEREF" 171s if sys.version_info >= (3, 12) 171s else "LOAD_CLASSDEREF" 171s ) 171s i_arg = 2 if sys.version_info >= (3, 11) else 1 171s concrete = ConcreteBytecode() 171s concrete.varnames = ["a"] 171s concrete.cellvars = ["__class__"] 171s concrete.freevars = ["__class__"] 171s concrete.extend( 171s [ 171s ConcreteInstr("LOAD_FAST", 0, lineno=1), 171s ConcreteInstr(i_name, i_arg, lineno=1), 171s ConcreteInstr("STORE_DEREF", i_arg, lineno=1), 171s ] 171s ) 171s 171s > bytecode = concrete.to_bytecode() 171s 171s tests/test_concrete.py:551: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 85 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________________ ConcreteBytecodeTests.test_negative_lnotab __________________ 171s 171s self = 171s 171s def test_negative_lnotab(self): 171s # x = 7 171s # y = 8 171s concrete = ConcreteBytecode( 171s [ 171s ConcreteInstr("LOAD_CONST", 0), 171s ConcreteInstr("STORE_NAME", 0), 171s # line number goes backward! 171s SetLineno(2), 171s ConcreteInstr("LOAD_CONST", 1), 171s ConcreteInstr("STORE_NAME", 1), 171s ] 171s ) 171s concrete.consts = [7, 8] 171s concrete.names = ["x", "y"] 171s concrete.first_lineno = 5 171s 171s > code = concrete.to_code() 171s 171s tests/test_concrete.py:337: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________ ConcreteBytecodeTests.test_to_bytecode_consts _________________ 171s 171s self = 171s 171s def test_to_bytecode_consts(self): 171s # x = -0.0 171s # x = +0.0 171s # 171s # code optimized by the CPython 3.6 peephole optimizer which emits 171s # duplicated constants (0.0 is twice in consts). 171s code = ConcreteBytecode() 171s code.consts = [0.0, None, -0.0, 0.0] 171s code.names = ["x", "y"] 171s code.extend( 171s [ 171s ConcreteInstr("LOAD_CONST", 2, lineno=1), 171s ConcreteInstr("STORE_NAME", 0, lineno=1), 171s ConcreteInstr("LOAD_CONST", 3, lineno=2), 171s ConcreteInstr("STORE_NAME", 1, lineno=2), 171s ConcreteInstr("LOAD_CONST", 1, lineno=2), 171s ConcreteInstr("RETURN_VALUE", lineno=2), 171s ] 171s ) 171s 171s > code = code.to_bytecode().to_concrete_bytecode() 171s 171s tests/test_concrete.py:448: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________________ ConcreteBytecodeTests.test_to_code_lnotab ___________________ 171s 171s self = 171s 171s def test_to_code_lnotab(self): 171s # We use an actual function for the simple case to 171s # ensure we get lnotab right 171s def f(): 171s # 171s # 171s x = 7 # noqa 171s y = 8 # noqa 171s z = 9 # noqa 171s 171s fl = f.__code__.co_firstlineno 171s concrete = ConcreteBytecode() 171s concrete.consts = [None, 7, 8, 9] 171s concrete.varnames = ["x", "y", "z"] 171s concrete.first_lineno = fl 171s concrete.extend( 171s ( 171s [ConcreteInstr("RESUME", 0), SetLineno(1)] 171s if sys.version_info >= (3, 11) 171s else [] 171s ) 171s + [ 171s SetLineno(fl + 3), 171s ConcreteInstr("LOAD_CONST", 1), 171s ConcreteInstr("STORE_FAST", 0), 171s SetLineno(fl + 4), 171s ConcreteInstr("LOAD_CONST", 2), 171s ConcreteInstr("STORE_FAST", 1), 171s SetLineno(fl + 5), 171s ConcreteInstr("LOAD_CONST", 3), 171s ConcreteInstr("STORE_FAST", 2), 171s ] 171s + ( 171s [ConcreteInstr("RETURN_CONST", 0)] 171s if sys.version_info >= (3, 12) 171s else [ 171s ConcreteInstr("LOAD_CONST", 0), 171s ConcreteInstr("RETURN_VALUE"), 171s ] 171s ) 171s ) 171s 171s > code = concrete.to_code() 171s 171s tests/test_concrete.py:308: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____________ ConcreteFromCodeTests.test_cellvar_freevar_roundtrip _____________ 171s 171s self = 171s 171s def test_cellvar_freevar_roundtrip(self): 171s from . import cell_free_vars_cases as cfc 171s 171s def recompile_code_and_inner(code): 171s concrete = ConcreteBytecode.from_code(code) 171s for i, c in enumerate(concrete.consts): 171s if isinstance(c, types.CodeType): 171s concrete.consts[i] = recompile_code_and_inner(c) 171s as_code = concrete.to_code( 171s stacksize=code.co_stacksize, compute_exception_stack_depths=False 171s ) 171s self.assertCodeObjectEqual(code, as_code) 171s return as_code 171s 171s for f in cfc.TEST_CASES: 171s print(f.__name__) 171s with self.subTest(f.__name__): 171s origin = f.__code__ 171s > f.__code__ = recompile_code_and_inner(origin) 171s 171s tests/test_concrete.py:1323: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/test_concrete.py:1312: in recompile_code_and_inner 171s concrete.consts[i] = recompile_code_and_inner(c) 171s tests/test_concrete.py:1316: in recompile_code_and_inner 171s self.assertCodeObjectEqual(code, as_code) 171s tests/__init__.py:171: in assertCodeObjectEqual 171s self.assertSequenceEqual( 171s 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)] 171s E 171s E First differing element 5: 171s E (25, 25, 15, 20) 171s E (25, 25, 8, 20) 171s E 171s E First sequence contains 1 additional elements. 171s E First extra element 6: 171s E (25, 25, 8, 20) 171s E 171s E [(None, None, None, None), 171s E (24, 24, 0, 0), 171s E (25, 25, 15, 16), 171s E (25, 25, 19, 20), 171s E (25, 25, 15, 20), 171s E - (25, 25, 15, 20), 171s E (25, 25, 8, 20)] 171s ----------------------------- Captured stdout call ----------------------------- 171s simple_cellvar 171s cellvar_share_name 171s cellvar_shared_and_unshared 171s ____________ ConcreteFromCodeTests.test_exception_table_round_trip _____________ 171s 171s self = 171s 171s def test_exception_table_round_trip(self): 171s from . import exception_handling_cases as ehc 171s 171s for f in ehc.TEST_CASES: 171s print(f.__name__) 171s with self.subTest(f.__name__): 171s origin = f.__code__ 171s concrete = ConcreteBytecode.from_code(f.__code__) 171s as_code = concrete.to_code( 171s stacksize=f.__code__.co_stacksize, 171s compute_exception_stack_depths=False, 171s ) 171s > self.assertCodeObjectEqual(origin, as_code) 171s 171s tests/test_concrete.py:1297: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/__init__.py:171: in assertCodeObjectEqual 171s self.assertSequenceEqual( 171s 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)] 171s E 171s E First differing element 10: 171s E (5, 5, 12, 22) 171s E (5, 6, 4, 21) 171s E 171s E First sequence contains 13 additional elements. 171s E First extra element 40: 171s E (None, None, None, None) 171s E 171s E Diff is 1155 characters long. Set self.maxDiff to None to see it. 171s ----------------------------- Captured stdout call ----------------------------- 171s try_except_group 171s ___________ ConcreteFromCodeTests.test_expected_arg_with_many_consts ___________ 171s 171s self = 171s 171s def test_expected_arg_with_many_consts(self): 171s def test(): 171s var = 0 171s var = 1 171s var = 2 171s var = 3 171s var = 4 171s var = 5 171s var = 6 171s var = 7 171s var = 8 171s var = 9 171s var = 10 171s var = 11 171s var = 12 171s var = 13 171s var = 14 171s var = 15 171s var = 16 171s var = 17 171s var = 18 171s var = 19 171s var = 20 171s var = 21 171s var = 22 171s var = 23 171s var = 24 171s var = 25 171s var = 26 171s var = 27 171s var = 28 171s var = 29 171s var = 30 171s var = 31 171s var = 32 171s var = 33 171s var = 34 171s var = 35 171s var = 36 171s var = 37 171s var = 38 171s var = 39 171s var = 40 171s var = 41 171s var = 42 171s var = 43 171s var = 44 171s var = 45 171s var = 46 171s var = 47 171s var = 48 171s var = 49 171s var = 50 171s var = 51 171s var = 52 171s var = 53 171s var = 54 171s var = 55 171s var = 56 171s var = 57 171s var = 58 171s var = 59 171s var = 60 171s var = 61 171s var = 62 171s var = 63 171s var = 64 171s var = 65 171s var = 66 171s var = 67 171s var = 68 171s var = 69 171s var = 70 171s var = 71 171s var = 72 171s var = 73 171s var = 74 171s var = 75 171s var = 76 171s var = 77 171s var = 78 171s var = 79 171s var = 80 171s var = 81 171s var = 82 171s var = 83 171s var = 84 171s var = 85 171s var = 86 171s var = 87 171s var = 88 171s var = 89 171s var = 90 171s var = 91 171s var = 92 171s var = 93 171s var = 94 171s var = 95 171s var = 96 171s var = 97 171s var = 98 171s var = 99 171s var = 100 171s var = 101 171s var = 102 171s var = 103 171s var = 104 171s var = 105 171s var = 106 171s var = 107 171s var = 108 171s var = 109 171s var = 110 171s var = 111 171s var = 112 171s var = 113 171s var = 114 171s var = 115 171s var = 116 171s var = 117 171s var = 118 171s var = 119 171s var = 120 171s var = 121 171s var = 122 171s var = 123 171s var = 124 171s var = 125 171s var = 126 171s var = 127 171s var = 128 171s var = 129 171s var = 130 171s var = 131 171s var = 132 171s var = 133 171s var = 134 171s var = 135 171s var = 136 171s var = 137 171s var = 138 171s var = 139 171s var = 140 171s var = 141 171s var = 142 171s var = 143 171s var = 144 171s var = 145 171s var = 146 171s var = 147 171s var = 148 171s var = 149 171s var = 150 171s var = 151 171s var = 152 171s var = 153 171s var = 154 171s var = 155 171s var = 156 171s var = 157 171s var = 158 171s var = 159 171s var = 160 171s var = 161 171s var = 162 171s var = 163 171s var = 164 171s var = 165 171s var = 166 171s var = 167 171s var = 168 171s var = 169 171s var = 170 171s var = 171 171s var = 172 171s var = 173 171s var = 174 171s var = 175 171s var = 176 171s var = 177 171s var = 178 171s var = 179 171s var = 180 171s var = 181 171s var = 182 171s var = 183 171s var = 184 171s var = 185 171s var = 186 171s var = 187 171s var = 188 171s var = 189 171s var = 190 171s var = 191 171s var = 192 171s var = 193 171s var = 194 171s var = 195 171s var = 196 171s var = 197 171s var = 198 171s var = 199 171s var = 200 171s var = 201 171s var = 202 171s var = 203 171s var = 204 171s var = 205 171s var = 206 171s var = 207 171s var = 208 171s var = 209 171s var = 210 171s var = 211 171s var = 212 171s var = 213 171s var = 214 171s var = 215 171s var = 216 171s var = 217 171s var = 218 171s var = 219 171s var = 220 171s var = 221 171s var = 222 171s var = 223 171s var = 224 171s var = 225 171s var = 226 171s var = 227 171s var = 228 171s var = 229 171s var = 230 171s var = 231 171s var = 232 171s var = 233 171s var = 234 171s var = 235 171s var = 236 171s var = 237 171s var = 238 171s var = 239 171s var = 240 171s var = 241 171s var = 242 171s var = 243 171s var = 244 171s var = 245 171s var = 246 171s var = 247 171s var = 248 171s var = 249 171s var = 250 171s var = 251 171s var = 252 171s var = 253 171s var = 254 171s var = 255 171s var = 256 171s var = 257 171s var = 258 171s var = 259 171s 171s return var 171s 171s test.__code__ = ConcreteBytecode.from_code( 171s test.__code__, extended_arg=True 171s > ).to_code() 171s 171s tests/test_concrete.py:1187: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________ ConcreteFromCodeTests.test_extended_arg_make_function _____________ 171s 171s self = 171s 171s def test_extended_arg_make_function(self): 171s if (3, 9) <= sys.version_info < (3, 10): 171s from .util_annotation import get_code as get_code_future 171s 171s code_obj = get_code_future( 171s """ 171s def foo(x: int, y: int): 171s pass 171s """ 171s ) 171s else: 171s code_obj = get_code( 171s """ 171s def foo(x: int, y: int): 171s pass 171s """ 171s ) 171s 171s # without EXTENDED_ARG 171s concrete = ConcreteBytecode.from_code(code_obj) 171s if sys.version_info >= (3, 11): 171s func_code = concrete.consts[2] 171s names = ["int", "foo"] 171s consts = ["x", "y", func_code, None] 171s const_offset = 1 171s name_offset = 1 171s first_instrs = [ 171s ConcreteInstr("LOAD_CONST", 0, lineno=1), 171s ConcreteInstr("LOAD_NAME", 0, lineno=1), 171s ConcreteInstr("LOAD_CONST", 1, lineno=1), 171s ConcreteInstr("LOAD_NAME", 0, lineno=1), 171s ConcreteInstr("BUILD_TUPLE", 4, lineno=1), 171s ] 171s elif sys.version_info >= (3, 10): 171s func_code = concrete.consts[2] 171s names = ["int", "foo"] 171s consts = ["x", "y", func_code, "foo", None] 171s const_offset = 1 171s name_offset = 1 171s first_instrs = [ 171s ConcreteInstr("LOAD_CONST", 0, lineno=1), 171s ConcreteInstr("LOAD_NAME", 0, lineno=1), 171s ConcreteInstr("LOAD_CONST", 1, lineno=1), 171s ConcreteInstr("LOAD_NAME", 0, lineno=1), 171s ConcreteInstr("BUILD_TUPLE", 4, lineno=1), 171s ] 171s elif ( 171s sys.version_info >= (3, 7) 171s and concrete.flags & CompilerFlags.FUTURE_ANNOTATIONS 171s ): 171s func_code = concrete.consts[2] 171s names = ["foo"] 171s consts = ["int", ("x", "y"), func_code, "foo", None] 171s const_offset = 1 171s name_offset = 0 171s first_instrs = [ 171s ConcreteInstr("LOAD_CONST", 0, lineno=1), 171s ConcreteInstr("LOAD_CONST", 0, lineno=1), 171s ConcreteInstr("LOAD_CONST", 0 + const_offset, lineno=1), 171s ConcreteInstr("BUILD_CONST_KEY_MAP", 2, lineno=1), 171s ] 171s else: 171s func_code = concrete.consts[1] 171s names = ["int", "foo"] 171s consts = [("x", "y"), func_code, "foo", None] 171s const_offset = 0 171s name_offset = 1 171s first_instrs = [ 171s ConcreteInstr("LOAD_NAME", 0, lineno=1), 171s ConcreteInstr("LOAD_NAME", 0, lineno=1), 171s ConcreteInstr("LOAD_CONST", 0 + const_offset, lineno=1), 171s ConcreteInstr("BUILD_CONST_KEY_MAP", 2, lineno=1), 171s ] 171s 171s self.assertSequenceEqual(concrete.names, names) 171s self.assertSequenceEqual(concrete.consts, consts) 171s expected = ( 171s first_instrs 171s + [ 171s ConcreteInstr("LOAD_CONST", 1 + const_offset, lineno=1), 171s ConcreteInstr("LOAD_CONST", 2 + const_offset, lineno=1), 171s > ConcreteInstr("MAKE_FUNCTION", 4, lineno=1), 171s ConcreteInstr("STORE_NAME", name_offset, lineno=1), 171s ] 171s + ( 171s [ConcreteInstr("RETURN_CONST", 3 + const_offset, lineno=1)] 171s if sys.version_info >= (3, 12) 171s else [ 171s ConcreteInstr("LOAD_CONST", 3 + const_offset, lineno=1), 171s ConcreteInstr("RETURN_VALUE", lineno=1), 171s ] 171s ) 171s ) 171s 171s tests/test_concrete.py:816: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:99: in __init__ 171s super().__init__(name, arg, lineno=lineno, location=location, offset=offset) 171s /usr/lib/python3/dist-packages/bytecode/instr.py:537: in __init__ 171s self._set(name, arg) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:120: in _set 171s super()._set(name, arg) 171s /usr/lib/python3/dist-packages/bytecode/instr.py:747: in _set 171s self._check_arg(name, opcode, arg) 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = <[AttributeError("'bytecode.concrete.ConcreteInstr' object has no attribute '_arg'") raised in repr()] ConcreteInstr object at 0x3ffa02b4340> 171s name = 'MAKE_FUNCTION', opcode = 26, arg = 4 171s 171s def _check_arg(self, name: str, opcode: int, arg: int) -> None: 171s if opcode_has_argument(opcode): 171s if arg is UNSET: 171s raise ValueError("operation %s requires an argument" % name) 171s 171s _check_arg_int(arg, name) 171s # opcode == 0 corresponds to CACHE instruction in 3.11+ and was unused before 171s elif opcode == 0: 171s arg = arg if arg is not UNSET else 0 171s _check_arg_int(arg, name) 171s else: 171s if arg is not UNSET: 171s > raise ValueError("operation %s has no argument" % name) 171s E ValueError: operation MAKE_FUNCTION has no argument 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:113: ValueError 171s _________________ ConcreteFromCodeTests.test_extended_arg_nop __________________ 171s 171s self = 171s 171s def test_extended_arg_nop(self): 171s constants = [None] * (0x000129 + 1) 171s constants[0x000129] = "Arbitrary String" 171s # EXTENDED_ARG 0x01, NOP 0xFF, EXTENDED_ARG 0x01, 171s # LOAD_CONST 0x29, RETURN_VALUE 0x00 171s codestring = bytes([0x90, 0x01, 0x09, 0xFF, 0x90, 0x01, 0x64, 0x29, 0x53, 0x00]) 171s codetype_list = [ 171s 0, 171s 0, 171s 0, 171s 1, 171s 64, 171s codestring, 171s tuple(constants), 171s (), 171s (), 171s "", 171s "code", 171s 1, 171s b"", 171s (), 171s (), 171s ] 171s if sys.version_info >= (3, 8): 171s codetype_list.insert(1, 0) 171s if sys.version_info >= (3, 11): 171s codetype_list.insert(12, "code") 171s codetype_list.insert(14, bytes()) 171s codetype_args = tuple(codetype_list) 171s code = types.CodeType(*codetype_args) 171s # Check it can be encoded and decoded 171s > codetype_output = Bytecode.from_code(code).to_code().co_consts 171s 171s tests/test_concrete.py:888: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 0 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ______________ ConcreteFromCodeTests.test_extended_arg_unpack_ex _______________ 171s 171s self = 171s 171s def test_extended_arg_unpack_ex(self): 171s def test(): 171s p = [1, 2, 3, 4, 5, 6] 171s q, r, *s, t = p 171s return q, r, s, t 171s 171s cpython_stacksize = test.__code__.co_stacksize 171s test.__code__ = ConcreteBytecode.from_code( 171s test.__code__, extended_arg=True 171s > ).to_code() 171s 171s tests/test_concrete.py:916: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ______________ ConcreteFromCodeTests.test_fail_extended_arg_jump _______________ 171s 171s self = 171s 171s def test_fail_extended_arg_jump(self): 171s def test(): 171s var = None 171s for _ in range(0, 1): 171s var = 0 171s var = 1 171s var = 2 171s var = 3 171s var = 4 171s var = 5 171s var = 6 171s var = 7 171s var = 8 171s var = 9 171s var = 10 171s var = 11 171s var = 12 171s var = 13 171s var = 14 171s var = 15 171s var = 16 171s var = 17 171s var = 18 171s var = 19 171s var = 20 171s var = 21 171s var = 22 171s var = 23 171s var = 24 171s var = 25 171s var = 26 171s var = 27 171s var = 28 171s var = 29 171s var = 30 171s var = 31 171s var = 32 171s var = 33 171s var = 34 171s var = 35 171s var = 36 171s var = 37 171s var = 38 171s var = 39 171s var = 40 171s var = 41 171s var = 42 171s var = 43 171s var = 44 171s var = 45 171s var = 46 171s var = 47 171s var = 48 171s var = 49 171s var = 50 171s var = 51 171s var = 52 171s var = 53 171s var = 54 171s var = 55 171s var = 56 171s var = 57 171s var = 58 171s var = 59 171s var = 60 171s var = 61 171s var = 62 171s var = 63 171s var = 64 171s var = 65 171s var = 66 171s var = 67 171s var = 68 171s var = 69 171s var = 70 171s return var 171s 171s # Generate the bytecode with extended arguments 171s bytecode = ConcreteBytecode.from_code(test.__code__, extended_arg=True) 171s > bytecode.to_code() 171s 171s tests/test_concrete.py:1270: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ___________________ ConcreteFromCodeTests.test_packing_lines ___________________ 171s 171s self = 171s 171s def test_packing_lines(self): 171s import dis 171s 171s from .long_lines_example import long_lines 171s 171s line_starts = list(dis.findlinestarts(long_lines.__code__)) 171s 171s concrete = ConcreteBytecode.from_code(long_lines.__code__) 171s > as_code = concrete.to_code() 171s 171s tests/test_concrete.py:1282: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________________ BytecodeToConcreteTests.test_cellvars _____________________ 171s 171s self = 171s 171s def test_cellvars(self): 171s code = Bytecode() 171s code.cellvars = ["x"] 171s code.freevars = ["y"] 171s code.extend( 171s [ 171s Instr("LOAD_DEREF", CellVar("x"), lineno=1), 171s Instr("LOAD_DEREF", FreeVar("y"), lineno=1), 171s ] 171s ) 171s > concrete = code.to_concrete_bytecode() 171s 171s tests/test_concrete.py:1604: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 84 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________ BytecodeToConcreteTests.test_compute_jumps_convergence ____________ 171s 171s self = 171s 171s def test_compute_jumps_convergence(self): 171s # Consider the following sequence of instructions: 171s # 171s # JUMP_FORWARD Label1 171s # JUMP_FORWARD Label2 171s # ...126 instructions... 171s # Label1: Offset 254 on first pass, 256 second pass 171s # NOP 171s # ... many more instructions ... 171s # Label2: Offset > 256 on first pass 171s # 171s # On first pass of compute_jumps(), Label2 will be at address 254, so 171s # that value encodes into the single byte arg of JUMP_ABSOLUTE. 171s # 171s # On second pass compute_jumps() the instr at Label1 will have offset 171s # of 256 so will also be given an EXTENDED_ARG. 171s # 171s # Thus we need to make an additional pass. This test only verifies 171s # case where 2 passes is insufficient but three is enough. 171s # 171s # On Python > 3.10 we need to double the number since the offset is now 171s # in term of instructions and not bytes. 171s 171s # Create code from comment above. 171s code = Bytecode() 171s label1 = Label() 171s label2 = Label() 171s nop = "NOP" 171s code.append(Instr("JUMP_FORWARD", label1)) 171s code.append(Instr("JUMP_FORWARD", label2)) 171s # range excludes the last point ... 171s for _ in range(4, 511 if OFFSET_AS_INSTRUCTION else 255, 2): 171s code.append(Instr(nop)) 171s code.append(label1) 171s code.append(Instr(nop)) 171s for _ in range( 171s 514 if OFFSET_AS_INSTRUCTION else 256, 171s 600 if OFFSET_AS_INSTRUCTION else 300, 171s 2, 171s ): 171s code.append(Instr(nop)) 171s code.append(label2) 171s code.append(Instr(nop)) 171s 171s # This should pass by default. 171s > code.to_code() 171s 171s tests/test_concrete.py:1653: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 79 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ______________ BytecodeToConcreteTests.test_dont_merge_constants _______________ 171s 171s self = 171s 171s def test_dont_merge_constants(self): 171s # test two constants which are equal but have a different type 171s code = Bytecode() 171s code.extend( 171s [ 171s Instr("LOAD_CONST", 5, lineno=1), 171s Instr("LOAD_CONST", 5.0, lineno=1), 171s Instr("LOAD_CONST", -0.0, lineno=1), 171s Instr("LOAD_CONST", +0.0, lineno=1), 171s ] 171s ) 171s 171s > code = code.to_concrete_bytecode() 171s 171s tests/test_concrete.py:1584: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s __________________ BytecodeToConcreteTests.test_extended_jump __________________ 171s 171s self = 171s 171s def test_extended_jump(self): 171s NOP = bytes((opcode.opmap["NOP"], 0)) 171s 171s # code using jumps > 0xffff to test extended arg 171s nb_nop = 2**16 if OFFSET_AS_INSTRUCTION else 2**15 171s # The length of the jump is independent of the number of instruction 171s # per the above logic. 171s jump = 2**16 171s code = ConcreteBytecode( 171s [ConcreteInstr("JUMP_FORWARD", jump)] 171s + [ConcreteInstr("NOP")] * nb_nop 171s + [ 171s ConcreteInstr("LOAD_CONST", 0), 171s ConcreteInstr("RETURN_VALUE"), 171s ], 171s consts=(None,), 171s ) 171s 171s > code_obj = code.to_code() 171s 171s tests/test_concrete.py:1514: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:862: in to_code 171s cfg = _bytecode.ControlFlowGraph.from_bytecode(self.to_bytecode()) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 79 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________ BytecodeToConcreteTests.test_extreme_compute_jumps_convergence ________ 171s 171s self = 171s 171s def test_extreme_compute_jumps_convergence(self): 171s """Test of compute_jumps() requiring absurd number of passes. 171s 171s NOTE: This test also serves to demonstrate that there is no worst 171s case: the number of passes can be unlimited (or, actually, limited by 171s the size of the provided code). 171s 171s This is an extension of test_compute_jumps_convergence. Instead of 171s two jumps, where the earlier gets extended after the latter, we 171s instead generate a series of many jumps. Each pass of compute_jumps() 171s extends one more instruction, which in turn causes the one behind it 171s to be extended on the next pass. 171s 171s """ 171s 171s # N: the number of unextended instructions that can be squeezed into a 171s # set of bytes adressable by the arg of an unextended instruction. 171s # The answer is "128", but here's how we arrive at it. 171s max_unextended_offset = 1 << 8 171s unextended_branch_instr_size = 2 171s N = max_unextended_offset // unextended_branch_instr_size 171s 171s # When using instruction rather than bytes in the offset multiply by 2 171s if OFFSET_AS_INSTRUCTION: 171s N *= 2 171s 171s nop = "UNARY_NEGATIVE" # don't use NOP, dis.stack_effect will raise 171s 171s # The number of jumps will be equal to the number of labels. The 171s # number of passes of compute_jumps() required will be one greater 171s # than this. 171s labels = [Label() for x in range(0, 3 * N)] 171s 171s code = Bytecode() 171s code.extend( 171s Instr("JUMP_FORWARD", labels[len(labels) - x - 1]) 171s for x in range(0, len(labels)) 171s ) 171s end_of_jumps = len(code) 171s code.extend(Instr(nop) for x in range(0, N)) 171s 171s # Now insert the labels. The first is N instructions (i.e. 256 171s # bytes) after the last jump. Then they proceed to earlier positions 171s # 4 bytes at a time. While the targets are in the range of the nop 171s # instructions, 4 bytes is two instructions. When the targets are in 171s # the range of JUMP_FORWARD instructions we have to allow for the fact 171s # that the instructions will have been extended to four bytes each, so 171s # working backwards 4 bytes per label means just one instruction per 171s # label. 171s offset = end_of_jumps + N 171s for index in range(0, len(labels)): 171s code.insert(offset, labels[index]) 171s if offset <= end_of_jumps: 171s offset -= 1 171s else: 171s offset -= 2 171s 171s code.insert(0, Instr("LOAD_CONST", 0)) 171s del end_of_jumps 171s code.append(Instr("RETURN_VALUE")) 171s 171s > code.to_code(compute_jumps_passes=(len(labels) + 1)) 171s 171s tests/test_concrete.py:1720: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________ BytecodeToConcreteTests.test_general_constants ________________ 171s 171s self = 171s 171s def test_general_constants(self): 171s """Test if general object could be linked as constants.""" 171s 171s class CustomObject: 171s pass 171s 171s class UnHashableCustomObject: 171s __hash__ = None 171s 171s obj1 = [1, 2, 3] 171s obj2 = {1, 2, 3} 171s obj3 = CustomObject() 171s obj4 = UnHashableCustomObject() 171s code = Bytecode( 171s [ 171s Instr("LOAD_CONST", obj1, lineno=1), 171s Instr("LOAD_CONST", obj2, lineno=1), 171s Instr("LOAD_CONST", obj3, lineno=1), 171s Instr("LOAD_CONST", obj4, lineno=1), 171s Instr("BUILD_TUPLE", 4, lineno=1), 171s Instr("RETURN_VALUE", lineno=1), 171s ] 171s ) 171s > self.assertEqual(code.to_code().co_consts, (obj1, obj2, obj3, obj4)) 171s 171s tests/test_concrete.py:1745: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ______________________ BytecodeToConcreteTests.test_jumps ______________________ 171s 171s self = 171s 171s def test_jumps(self): 171s # if test: 171s # x = 12 171s # else: 171s # x = 37 171s code = Bytecode() 171s label_else = Label() 171s label_return = Label() 171s code.extend( 171s [ 171s Instr("LOAD_NAME", "test", lineno=1), 171s Instr( 171s "POP_JUMP_FORWARD_IF_FALSE" 171s if (3, 12) > sys.version_info >= (3, 11) 171s else "POP_JUMP_IF_FALSE", 171s label_else, 171s ), 171s Instr("LOAD_CONST", 12, lineno=2), 171s Instr("STORE_NAME", "x"), 171s Instr("JUMP_FORWARD", label_return), 171s label_else, 171s Instr("LOAD_CONST", 37, lineno=4), 171s Instr("STORE_NAME", "x"), 171s label_return, 171s Instr("LOAD_CONST", None, lineno=4), 171s Instr("RETURN_VALUE"), 171s ] 171s ) 171s 171s > code = code.to_concrete_bytecode() 171s 171s tests/test_concrete.py:1549: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 92 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ______________________ BytecodeToConcreteTests.test_label ______________________ 171s 171s self = 171s 171s def test_label(self): 171s code = Bytecode() 171s label = Label() 171s code.extend( 171s [ 171s Instr("LOAD_CONST", "hello", lineno=1), 171s Instr("JUMP_FORWARD", label, lineno=1), 171s label, 171s Instr("POP_TOP", lineno=1), 171s ] 171s ) 171s 171s > code = code.to_concrete_bytecode() 171s 171s tests/test_concrete.py:1341: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____________________ BytecodeToConcreteTests.test_label2 ______________________ 171s 171s self = 171s 171s def test_label2(self): 171s bytecode = Bytecode() 171s label = Label() 171s bytecode.extend( 171s [ 171s Instr("LOAD_NAME", "test", lineno=1), 171s Instr( 171s "POP_JUMP_FORWARD_IF_FALSE" 171s if (3, 12) > sys.version_info >= (3, 11) 171s else "POP_JUMP_IF_FALSE", 171s label, 171s ), 171s Instr("LOAD_CONST", 5, lineno=2), 171s Instr("STORE_NAME", "x"), 171s Instr("JUMP_FORWARD", label), 171s Instr("LOAD_CONST", 7, lineno=4), 171s Instr("STORE_NAME", "x"), 171s label, 171s Instr("LOAD_CONST", None), 171s Instr("RETURN_VALUE"), 171s ] 171s ) 171s 171s > concrete = bytecode.to_concrete_bytecode() 171s 171s tests/test_concrete.py:1373: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 92 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____________________ BytecodeToConcreteTests.test_label3 ______________________ 171s 171s self = 171s 171s def test_label3(self): 171s """ 171s CPython generates useless EXTENDED_ARG 0 in some cases. We need to 171s properly track them as otherwise we can end up with broken offset for 171s jumps. 171s """ 171s source = """ 171s def func(x): 171s if x == 1: 171s return x + 0 171s elif x == 2: 171s return x + 1 171s elif x == 3: 171s return x + 2 171s elif x == 4: 171s return x + 3 171s elif x == 5: 171s return x + 4 171s elif x == 6: 171s return x + 5 171s elif x == 7: 171s return x + 6 171s elif x == 8: 171s return x + 7 171s elif x == 9: 171s return x + 8 171s elif x == 10: 171s return x + 9 171s elif x == 11: 171s return x + 10 171s elif x == 12: 171s return x + 11 171s elif x == 13: 171s return x + 12 171s elif x == 14: 171s return x + 13 171s elif x == 15: 171s return x + 14 171s elif x == 16: 171s return x + 15 171s elif x == 17: 171s return x + 16 171s return -1 171s """ 171s code = get_code(source, function=True) 171s > bcode = Bytecode.from_code(code) 171s 171s tests/test_concrete.py:1441: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ____________________ BytecodeToConcreteTests.test_setlineno ____________________ 171s 171s self = 171s 171s def test_setlineno(self): 171s # x = 7 171s # y = 8 171s # z = 9 171s concrete = ConcreteBytecode() 171s concrete.consts = [7, 8, 9] 171s concrete.names = ["x", "y", "z"] 171s concrete.first_lineno = 3 171s concrete.extend( 171s [ 171s ConcreteInstr("LOAD_CONST", 0), 171s ConcreteInstr("STORE_NAME", 0), 171s SetLineno(4), 171s ConcreteInstr("LOAD_CONST", 1), 171s ConcreteInstr("STORE_NAME", 1), 171s SetLineno(5), 171s ConcreteInstr("LOAD_CONST", 2), 171s ConcreteInstr("STORE_NAME", 2), 171s ] 171s ) 171s 171s > code = concrete.to_bytecode() 171s 171s tests/test_concrete.py:1483: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 83 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____________________________ InstrTests.test_attr _____________________________ 171s 171s self = 171s 171s def test_attr(self): 171s instr = Instr("LOAD_CONST", 3, lineno=5) 171s self.assertEqual(instr.name, "LOAD_CONST") 171s > self.assertEqual(instr.opcode, 100) 171s E AssertionError: 83 != 100 171s 171s tests/test_instr.py:232: AssertionError 171s _____________ InstrTests.test_code_object_containing_mutable_data ______________ 171s 171s self = 171s 171s def test_code_object_containing_mutable_data(self): 171s from types import CodeType 171s 171s from bytecode import Bytecode, Instr 171s 171s def f(): 171s def g(): 171s # Under Python 3.12+ we need a temporary var to be sure we use 171s # LOAD_CONST rather than RETURN_CONST 171s a = "value" 171s return a 171s 171s return g 171s 171s > f_code = Bytecode.from_code(f.__code__) 171s 171s tests/test_instr.py:434: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ________________________ CompareTests.test_compare_ops _________________________ 171s 171s self = 171s 171s def test_compare_ops(self): 171s from bytecode import Bytecode, Instr 171s 171s def f(): 171s pass 171s 171s params = zip(iter(Compare), (True, True, False, True, False, False)) 171s for cmp, expected in params: 171s with self.subTest(cmp): 171s bcode = Bytecode( 171s ([Instr("RESUME", 0)] if sys.version_info >= (3, 11) else []) 171s + [ 171s Instr("LOAD_CONST", 24), 171s Instr("LOAD_CONST", 42), 171s Instr("COMPARE_OP", cmp), 171s Instr("RETURN_VALUE"), 171s ] 171s ) 171s > f.__code__ = bcode.to_code() 171s 171s tests/test_instr.py:479: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:312: in to_code 171s bc = self.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:327: in to_concrete_bytecode 171s return converter.to_concrete_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1408: in to_concrete_bytecode 171s self.concrete_instructions() 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:1282: in concrete_instructions 171s self.required_caches = c_instr.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _________________________ DumpCodeTests.test_bytecode __________________________ 171s 171s self = 171s 171s def test_bytecode(self): 171s source = """ 171s def func(test): 171s if test == 1: 171s return 1 171s elif test == 2: 171s return 2 171s return 3 171s """ 171s > code = disassemble(source, function=True) 171s 171s tests/test_misc.py:37: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s ______________________ DumpCodeTests.test_bytecode_blocks ______________________ 171s 171s self = 171s 171s def test_bytecode_blocks(self): 171s source = """ 171s def func(test): 171s if test == 1: 171s return 1 171s elif test == 2: 171s return 2 171s return 3 171s """ 171s > code = disassemble(source, function=True) 171s 171s tests/test_misc.py:206: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s _____________________ DumpCodeTests.test_concrete_bytecode _____________________ 171s 171s self = 171s 171s def test_concrete_bytecode(self): 171s source = """ 171s def func(test): 171s if test == 1: 171s return 1 171s elif test == 2: 171s return 2 171s return 3 171s """ 171s > code = disassemble(source, function=True) 171s 171s tests/test_misc.py:409: 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s tests/__init__.py:143: in disassemble 171s return Bytecode.from_code(code) 171s /usr/lib/python3/dist-packages/bytecode/bytecode.py:283: in from_code 171s return concrete.to_bytecode( 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:943: in to_bytecode 171s target = c_instr.get_jump_target(offset) 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:145: in get_jump_target 171s ) + self.use_cache_opcodes() 171s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 171s 171s self = 171s 171s def use_cache_opcodes(self) -> int: 171s return ( 171s # Not supposed to be used but we need it 171s > dis._inline_cache_entries[self._opcode] # type: ignore 171s if sys.version_info >= (3, 11) 171s else 0 171s ) 171s E KeyError: 149 171s 171s /usr/lib/python3/dist-packages/bytecode/concrete.py:188: KeyError 171s =========================== short test summary info ============================ 171s FAILED tests/test_bytecode.py::BytecodeTests::test_cellvar_freevar_roundtrip 171s FAILED tests/test_bytecode.py::BytecodeTests::test_eq - KeyError: 149 171s FAILED tests/test_bytecode.py::BytecodeTests::test_eq_with_try - KeyError: 149 171s FAILED tests/test_bytecode.py::BytecodeTests::test_exception_table_round_trip 171s FAILED tests/test_bytecode.py::BytecodeTests::test_from_code - KeyError: 149 171s FAILED tests/test_bytecode.py::BytecodeTests::test_from_code_freevars - KeyEr... 171s FAILED tests/test_bytecode.py::BytecodeTests::test_from_code_load_fast - KeyE... 171s FAILED tests/test_bytecode.py::BytecodeTests::test_negative_size_binary_with_disable_check_of_pre_and_post 171s FAILED tests/test_bytecode.py::BytecodeTests::test_negative_size_build_const_map_with_disable_check_of_pre_and_post 171s FAILED tests/test_bytecode.py::BytecodeTests::test_negative_size_build_map_with_disable_check_of_pre_and_post 171s FAILED tests/test_bytecode.py::BytecodeTests::test_negative_size_unary_with_disable_check_of_pre_and_post 171s FAILED tests/test_bytecode.py::BytecodeTests::test_not_enough_copy_with_disable_check_of_pre_and_post 171s FAILED tests/test_bytecode.py::BytecodeTests::test_not_enough_swap_with_disable_check_of_pre_and_post 171s FAILED tests/test_bytecode.py::BytecodeTests::test_setlineno - KeyError: 83 171s FAILED tests/test_bytecode.py::BytecodeTests::test_to_code - KeyError: 92 171s FAILED tests/test_cfg.py::BytecodeBlocksTests::test_attr - KeyError: 149 171s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_eq - KeyError: 149 171s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_eq_with_try_except 171s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_split_block - K... 171s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_split_block_dont_split 171s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_split_block_end 171s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_split_block_error 171s FAILED tests/test_cfg.py::BytecodeBlocksFunctionalTests::test_to_code - KeyEr... 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_and 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_for_loop_continue 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_if_else 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_nested_try_except_else_finally 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_nested_try_except_finally 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_or 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_try_except 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_try_except_else_finally 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_try_except_finally 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_try_finally 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_while_loop_break 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_computation_with 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_with_dead_code 171s FAILED tests/test_cfg.py::CFGStacksizeComputationTests::test_stack_size_with_dead_code2 171s FAILED tests/test_cfg.py::CFGRoundTripTests::test_cellvar_freevar_roundtrip 171s FAILED tests/test_cfg.py::CFGRoundTripTests::test_roundtrip_exception_handling 171s FAILED tests/test_code.py::CodeTests::test_async_func - KeyError: 35 171s FAILED tests/test_code.py::CodeTests::test_generator_func - KeyError: 35 171s FAILED tests/test_code.py::CodeTests::test_kwargs - KeyError: 149 171s FAILED tests/test_code.py::CodeTests::test_kwonlyargs - KeyError: 149 171s FAILED tests/test_code.py::CodeTests::test_loop - KeyError: 149 171s FAILED tests/test_code.py::CodeTests::test_varargs - KeyError: 149 171s FAILED tests/test_concrete.py::ConcreteInstrTests::test_assemble - AssertionE... 171s FAILED tests/test_concrete.py::ConcreteInstrTests::test_attr - AssertionError... 171s FAILED tests/test_concrete.py::ConcreteInstrTests::test_disassemble - Asserti... 171s FAILED tests/test_concrete.py::ConcreteInstrTests::test_get_jump_target - Key... 171s FAILED tests/test_concrete.py::ConcreteInstrTests::test_set_attr - AssertionE... 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_cellvar - KeyError... 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_cellvar_freevar - ... 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_eq - KeyError: 83 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_explicit_stacksize 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_extended_lnotab - ... 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_extended_lnotab2 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_freevar - KeyError... 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_load_classderef - ... 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_negative_lnotab - ... 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_to_bytecode_consts 171s FAILED tests/test_concrete.py::ConcreteBytecodeTests::test_to_code_lnotab - K... 171s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_cellvar_freevar_roundtrip 171s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_exception_table_round_trip 171s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_expected_arg_with_many_consts 171s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_extended_arg_make_function 171s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_extended_arg_nop 171s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_extended_arg_unpack_ex 171s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_fail_extended_arg_jump 171s FAILED tests/test_concrete.py::ConcreteFromCodeTests::test_packing_lines - Ke... 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_cellvars - KeyEr... 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_compute_jumps_convergence 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_dont_merge_constants 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_extended_jump - ... 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_extreme_compute_jumps_convergence 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_general_constants 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_jumps - KeyError... 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_label - KeyError... 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_label2 - KeyErro... 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_label3 - KeyErro... 171s FAILED tests/test_concrete.py::BytecodeToConcreteTests::test_setlineno - KeyE... 171s FAILED tests/test_instr.py::InstrTests::test_attr - AssertionError: 83 != 100 171s FAILED tests/test_instr.py::InstrTests::test_code_object_containing_mutable_data 171s FAILED tests/test_instr.py::CompareTests::test_compare_ops - KeyError: 149 171s FAILED tests/test_misc.py::DumpCodeTests::test_bytecode - KeyError: 149 171s FAILED tests/test_misc.py::DumpCodeTests::test_bytecode_blocks - KeyError: 149 171s FAILED tests/test_misc.py::DumpCodeTests::test_concrete_bytecode - KeyError: 149 171s =================== 86 failed, 71 passed, 8 skipped in 4.56s =================== 172s autopkgtest [20:38:56]: test pytest: -----------------------] 172s pytest FAIL non-zero exit status 1 172s autopkgtest [20:38:56]: test pytest: - - - - - - - - - - results - - - - - - - - - - 173s autopkgtest [20:38:57]: @@@@@@@@@@@@@@@@@@@@ summary 173s pytest FAIL non-zero exit status 1 178s nova [W] Using flock in prodstack6-s390x 178s Creating nova instance adt-plucky-s390x-python-bytecode-20241123-203604-juju-7f2275-prod-proposed-migration-environment-15-0b12c6ef-f4ed-4b04-8c42-4570b58429fd from image adt/ubuntu-plucky-s390x-server-20241119.img (UUID 0efe7a44-24e0-44d8-af6e-8997f14b87bd)...