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