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