0s autopkgtest [11:42:01]: starting date and time: 2025-11-17 11:42:01+0000 0s autopkgtest [11:42:01]: git checkout: 508d4a25 a-v-ssh wait_for_ssh: demote "ssh connection failed" to a debug message 0s autopkgtest [11:42:01]: host juju-7f2275-prod-proposed-migration-environment-9; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.pptut30y/out --timeout-copy=6000 --setup-commands 'ln -s /dev/null /etc/systemd/system/bluetooth.service; printf "http_proxy=http://squid.internal:3128\nhttps_proxy=http://squid.internal:3128\nno_proxy=127.0.0.1,127.0.1.1,localhost,localdomain,internal,login.ubuntu.com,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com,radosgw.ps5.canonical.com\n" >> /etc/environment' --apt-pocket=proposed=src:python3-defaults --apt-upgrade astroid --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=python3-defaults/3.13.7-2 -- lxd -r lxd-armhf-10.145.243.149 lxd-armhf-10.145.243.149:autopkgtest/ubuntu/resolute/armhf 21s autopkgtest [11:42:22]: testbed dpkg architecture: armhf 23s autopkgtest [11:42:24]: testbed apt version: 3.1.11 26s autopkgtest [11:42:27]: @@@@@@@@@@@@@@@@@@@@ test bed setup 28s autopkgtest [11:42:29]: testbed release detected to be: None 36s autopkgtest [11:42:37]: updating testbed package index (apt update) 38s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease [87.8 kB] 38s Get:2 http://ftpmaster.internal/ubuntu resolute InRelease [87.8 kB] 38s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 38s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 38s Get:5 http://ftpmaster.internal/ubuntu resolute-proposed/restricted Sources [9848 B] 38s Get:6 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse Sources [22.9 kB] 38s Get:7 http://ftpmaster.internal/ubuntu resolute-proposed/main Sources [81.1 kB] 38s Get:8 http://ftpmaster.internal/ubuntu resolute-proposed/universe Sources [868 kB] 39s Get:9 http://ftpmaster.internal/ubuntu resolute-proposed/main armhf Packages [138 kB] 39s Get:10 http://ftpmaster.internal/ubuntu resolute-proposed/restricted armhf Packages [940 B] 39s Get:11 http://ftpmaster.internal/ubuntu resolute-proposed/universe armhf Packages [536 kB] 39s Get:12 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse armhf Packages [9684 B] 39s Get:13 http://ftpmaster.internal/ubuntu resolute/universe Sources [21.3 MB] 40s Get:14 http://ftpmaster.internal/ubuntu resolute/main Sources [1416 kB] 40s Get:15 http://ftpmaster.internal/ubuntu resolute/main armhf Packages [1369 kB] 40s Get:16 http://ftpmaster.internal/ubuntu resolute/universe armhf Packages [15.2 MB] 43s Fetched 41.1 MB in 5s (7532 kB/s) 44s Reading package lists... 50s autopkgtest [11:42:51]: upgrading testbed (apt dist-upgrade and autopurge) 52s Reading package lists... 52s Building dependency tree... 52s Reading state information... 52s Calculating upgrade... 53s The following packages will be upgraded: 53s libpython3-stdlib python3 python3-minimal usbutils 53s 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 53s Need to get 140 kB of archives. 53s After this operation, 0 B of additional disk space will be used. 53s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed/main armhf python3-minimal armhf 3.13.7-2 [27.8 kB] 53s Get:2 http://ftpmaster.internal/ubuntu resolute-proposed/main armhf python3 armhf 3.13.7-2 [23.9 kB] 53s Get:3 http://ftpmaster.internal/ubuntu resolute-proposed/main armhf libpython3-stdlib armhf 3.13.7-2 [10.6 kB] 53s Get:4 http://ftpmaster.internal/ubuntu resolute/main armhf usbutils armhf 1:019-1 [77.7 kB] 54s Fetched 140 kB in 0s (384 kB/s) 54s (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 ... 65904 files and directories currently installed.) 54s Preparing to unpack .../python3-minimal_3.13.7-2_armhf.deb ... 54s Unpacking python3-minimal (3.13.7-2) over (3.13.7-1) ... 54s Setting up python3-minimal (3.13.7-2) ... 54s (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 ... 65904 files and directories currently installed.) 54s Preparing to unpack .../python3_3.13.7-2_armhf.deb ... 54s Unpacking python3 (3.13.7-2) over (3.13.7-1) ... 54s Preparing to unpack .../libpython3-stdlib_3.13.7-2_armhf.deb ... 54s Unpacking libpython3-stdlib:armhf (3.13.7-2) over (3.13.7-1) ... 54s Preparing to unpack .../usbutils_1%3a019-1_armhf.deb ... 54s Unpacking usbutils (1:019-1) over (1:018-2) ... 54s Setting up usbutils (1:019-1) ... 54s Setting up libpython3-stdlib:armhf (3.13.7-2) ... 54s Setting up python3 (3.13.7-2) ... 54s Processing triggers for man-db (2.13.1-1) ... 57s Reading package lists... 58s Building dependency tree... 58s Reading state information... 58s Solving dependencies... 58s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 60s autopkgtest [11:43:01]: rebooting testbed after setup commands that affected boot 101s autopkgtest [11:43:42]: testbed running kernel: Linux 6.8.0-86-generic #87~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 29 09:26:46 UTC 2 126s autopkgtest [11:44:07]: @@@@@@@@@@@@@@@@@@@@ apt-source astroid 137s Get:1 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (dsc) [2268 B] 137s Get:2 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (tar) [467 kB] 137s Get:3 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (diff) [5604 B] 137s gpgv: Signature made Sun Jan 19 13:16:35 2025 UTC 137s gpgv: using RSA key 8F6DE104377F3B11E741748731F3144544A1741A 137s gpgv: issuer "tchet@debian.org" 137s gpgv: Can't check signature: No public key 137s dpkg-source: warning: cannot verify inline signature for ./astroid_3.3.8-2.dsc: no acceptable signature found 137s autopkgtest [11:44:18]: testing package astroid version 3.3.8-2 139s autopkgtest [11:44:20]: build not needed 143s autopkgtest [11:44:24]: test pybuild-autopkgtest: preparing testbed 144s Reading package lists... 145s Building dependency tree... 145s Reading state information... 145s Solving dependencies... 145s The following NEW packages will be installed: 145s autoconf automake autopoint autotools-dev build-essential cpp cpp-15 145s cpp-15-arm-linux-gnueabihf cpp-arm-linux-gnueabihf debhelper debugedit 145s dh-autoreconf dh-python dh-strip-nondeterminism dwz g++ g++-15 145s g++-15-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc gcc-15 145s gcc-15-arm-linux-gnueabihf gcc-arm-linux-gnueabihf gettext intltool-debian 145s libarchive-zip-perl libasan8 libc-dev-bin libc6-dev libcc1-0 libcrypt-dev 145s libdebhelper-perl libdw1t64 libfile-stripnondeterminism-perl libgcc-15-dev 145s libgomp1 libisl23 libmpc3 libpython3.14-minimal libpython3.14-stdlib 145s libstdc++-15-dev libtool libubsan1 linux-libc-dev m4 po-debconf 145s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python3-all 145s python3-astroid python3-build python3-iniconfig python3-installer 146s python3-lazy-object-proxy python3-pip python3-pluggy python3-pyproject-hooks 146s python3-pytest python3-pytest-runner python3-wheel python3-wrapt python3.14 146s python3.14-minimal rpcsvc-proto 146s 0 upgraded, 64 newly installed, 0 to remove and 0 not upgraded. 146s Need to get 66.5 MB of archives. 146s After this operation, 204 MB of additional disk space will be used. 146s Get:1 http://ftpmaster.internal/ubuntu resolute/main armhf libpython3.14-minimal armhf 3.14.0-4 [892 kB] 146s Get:2 http://ftpmaster.internal/ubuntu resolute/main armhf python3.14-minimal armhf 3.14.0-4 [2146 kB] 147s Get:3 http://ftpmaster.internal/ubuntu resolute/main armhf m4 armhf 1.4.20-2 [212 kB] 147s Get:4 http://ftpmaster.internal/ubuntu resolute/main armhf autoconf all 2.72-3.1ubuntu1 [384 kB] 147s Get:5 http://ftpmaster.internal/ubuntu resolute/main armhf autotools-dev all 20240727.1 [43.4 kB] 147s Get:6 http://ftpmaster.internal/ubuntu resolute/main armhf automake all 1:1.18.1-2 [581 kB] 147s Get:7 http://ftpmaster.internal/ubuntu resolute/main armhf autopoint all 0.23.2-1 [620 kB] 147s Get:8 http://ftpmaster.internal/ubuntu resolute/main armhf libc-dev-bin armhf 2.42-2ubuntu2 [21.8 kB] 147s Get:9 http://ftpmaster.internal/ubuntu resolute/main armhf linux-libc-dev armhf 6.17.0-5.5 [1771 kB] 148s Get:10 http://ftpmaster.internal/ubuntu resolute/main armhf libcrypt-dev armhf 1:4.4.38-1build1 [120 kB] 148s Get:11 http://ftpmaster.internal/ubuntu resolute/main armhf rpcsvc-proto armhf 1.4.3-1 [62.3 kB] 148s Get:12 http://ftpmaster.internal/ubuntu resolute/main armhf libc6-dev armhf 2.42-2ubuntu2 [1416 kB] 148s Get:13 http://ftpmaster.internal/ubuntu resolute/main armhf libisl23 armhf 0.27-1 [546 kB] 148s Get:14 http://ftpmaster.internal/ubuntu resolute/main armhf libmpc3 armhf 1.3.1-2 [47.0 kB] 148s Get:15 http://ftpmaster.internal/ubuntu resolute/main armhf cpp-15-arm-linux-gnueabihf armhf 15.2.0-7ubuntu1 [10.1 MB] 149s Get:16 http://ftpmaster.internal/ubuntu resolute/main armhf cpp-15 armhf 15.2.0-7ubuntu1 [1030 B] 149s Get:17 http://ftpmaster.internal/ubuntu resolute/main armhf cpp-arm-linux-gnueabihf armhf 4:15.2.0-4ubuntu1 [5756 B] 149s Get:18 http://ftpmaster.internal/ubuntu resolute/main armhf cpp armhf 4:15.2.0-4ubuntu1 [22.4 kB] 149s Get:19 http://ftpmaster.internal/ubuntu resolute/main armhf libcc1-0 armhf 15.2.0-7ubuntu1 [43.5 kB] 149s Get:20 http://ftpmaster.internal/ubuntu resolute/main armhf libgomp1 armhf 15.2.0-7ubuntu1 [129 kB] 149s Get:21 http://ftpmaster.internal/ubuntu resolute/main armhf libasan8 armhf 15.2.0-7ubuntu1 [2950 kB] 149s Get:22 http://ftpmaster.internal/ubuntu resolute/main armhf libubsan1 armhf 15.2.0-7ubuntu1 [1187 kB] 149s Get:23 http://ftpmaster.internal/ubuntu resolute/main armhf libgcc-15-dev armhf 15.2.0-7ubuntu1 [898 kB] 149s Get:24 http://ftpmaster.internal/ubuntu resolute/main armhf gcc-15-arm-linux-gnueabihf armhf 15.2.0-7ubuntu1 [19.5 MB] 150s Get:25 http://ftpmaster.internal/ubuntu resolute/main armhf gcc-15 armhf 15.2.0-7ubuntu1 [493 kB] 150s Get:26 http://ftpmaster.internal/ubuntu resolute/main armhf gcc-arm-linux-gnueabihf armhf 4:15.2.0-4ubuntu1 [1220 B] 150s Get:27 http://ftpmaster.internal/ubuntu resolute/main armhf gcc armhf 4:15.2.0-4ubuntu1 [5022 B] 150s Get:28 http://ftpmaster.internal/ubuntu resolute/main armhf libstdc++-15-dev armhf 15.2.0-7ubuntu1 [2637 kB] 150s Get:29 http://ftpmaster.internal/ubuntu resolute/main armhf g++-15-arm-linux-gnueabihf armhf 15.2.0-7ubuntu1 [11.4 MB] 150s Get:30 http://ftpmaster.internal/ubuntu resolute/main armhf g++-15 armhf 15.2.0-7ubuntu1 [23.7 kB] 150s Get:31 http://ftpmaster.internal/ubuntu resolute/main armhf g++-arm-linux-gnueabihf armhf 4:15.2.0-4ubuntu1 [968 B] 150s Get:32 http://ftpmaster.internal/ubuntu resolute/main armhf g++ armhf 4:15.2.0-4ubuntu1 [1086 B] 150s Get:33 http://ftpmaster.internal/ubuntu resolute/main armhf build-essential armhf 12.12ubuntu1 [5088 B] 150s Get:34 http://ftpmaster.internal/ubuntu resolute/main armhf libdebhelper-perl all 13.24.2ubuntu1 [95.7 kB] 150s Get:35 http://ftpmaster.internal/ubuntu resolute/main armhf libtool all 2.5.4-7 [169 kB] 150s Get:36 http://ftpmaster.internal/ubuntu resolute/main armhf dh-autoreconf all 21 [12.5 kB] 150s Get:37 http://ftpmaster.internal/ubuntu resolute/main armhf libarchive-zip-perl all 1.68-1 [90.2 kB] 150s Get:38 http://ftpmaster.internal/ubuntu resolute/main armhf libfile-stripnondeterminism-perl all 1.15.0-1 [20.5 kB] 150s Get:39 http://ftpmaster.internal/ubuntu resolute/main armhf dh-strip-nondeterminism all 1.15.0-1 [5090 B] 150s Get:40 http://ftpmaster.internal/ubuntu resolute/main armhf libdw1t64 armhf 0.194-1 [254 kB] 150s Get:41 http://ftpmaster.internal/ubuntu resolute/main armhf debugedit armhf 1:5.2-3 [48.9 kB] 150s Get:42 http://ftpmaster.internal/ubuntu resolute/main armhf dwz armhf 0.16-2 [114 kB] 150s Get:43 http://ftpmaster.internal/ubuntu resolute/main armhf gettext armhf 0.23.2-1 [1059 kB] 150s Get:44 http://ftpmaster.internal/ubuntu resolute/main armhf intltool-debian all 0.35.0+20060710.6 [23.2 kB] 150s Get:45 http://ftpmaster.internal/ubuntu resolute/main armhf po-debconf all 1.0.21+nmu1 [233 kB] 150s Get:46 http://ftpmaster.internal/ubuntu resolute/main armhf debhelper all 13.24.2ubuntu1 [896 kB] 150s Get:47 http://ftpmaster.internal/ubuntu resolute/universe armhf dh-python all 6.20250414 [119 kB] 150s Get:48 http://ftpmaster.internal/ubuntu resolute/main armhf libpython3.14-stdlib armhf 3.14.0-4 [2270 kB] 151s Get:49 http://ftpmaster.internal/ubuntu resolute/universe armhf pybuild-plugin-autopkgtest all 6.20250414 [1746 B] 151s Get:50 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-pyproject-hooks all 1.2.0-1 [10.2 kB] 151s Get:51 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-wheel all 0.46.1-2 [22.1 kB] 151s Get:52 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-build all 1.2.2-4 [31.0 kB] 151s Get:53 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-installer all 0.7.0+dfsg1-3 [17.4 kB] 151s Get:54 http://ftpmaster.internal/ubuntu resolute/universe armhf pybuild-plugin-pyproject all 6.20250414 [1728 B] 151s Get:55 http://ftpmaster.internal/ubuntu resolute/main armhf python3.14 armhf 3.14.0-4 [805 kB] 151s Get:56 http://ftpmaster.internal/ubuntu resolute-proposed/main armhf python3-all armhf 3.13.7-2 [890 B] 151s Get:57 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-astroid all 3.3.8-2 [175 kB] 151s Get:58 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-iniconfig all 2.1.0-1 [6840 B] 151s Get:59 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-lazy-object-proxy armhf 1.12.0-1 [24.4 kB] 151s Get:60 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-pip all 25.1.1+dfsg-1ubuntu2 [1416 kB] 151s Get:61 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-pluggy all 1.6.0-1 [21.0 kB] 151s Get:62 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-pytest all 8.3.5-2 [252 kB] 151s Get:63 http://ftpmaster.internal/ubuntu resolute/universe armhf python3-pytest-runner all 2.11.1-5 [7592 B] 151s Get:64 http://ftpmaster.internal/ubuntu resolute/main armhf python3-wrapt armhf 1.17.3-2 [38.0 kB] 151s Fetched 66.5 MB in 5s (12.8 MB/s) 151s Selecting previously unselected package libpython3.14-minimal:armhf. 152s (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 ... 65904 files and directories currently installed.) 152s Preparing to unpack .../00-libpython3.14-minimal_3.14.0-4_armhf.deb ... 152s Unpacking libpython3.14-minimal:armhf (3.14.0-4) ... 152s Selecting previously unselected package python3.14-minimal. 152s Preparing to unpack .../01-python3.14-minimal_3.14.0-4_armhf.deb ... 152s Unpacking python3.14-minimal (3.14.0-4) ... 152s Selecting previously unselected package m4. 152s Preparing to unpack .../02-m4_1.4.20-2_armhf.deb ... 152s Unpacking m4 (1.4.20-2) ... 152s Selecting previously unselected package autoconf. 152s Preparing to unpack .../03-autoconf_2.72-3.1ubuntu1_all.deb ... 152s Unpacking autoconf (2.72-3.1ubuntu1) ... 152s Selecting previously unselected package autotools-dev. 152s Preparing to unpack .../04-autotools-dev_20240727.1_all.deb ... 152s Unpacking autotools-dev (20240727.1) ... 152s Selecting previously unselected package automake. 152s Preparing to unpack .../05-automake_1%3a1.18.1-2_all.deb ... 152s Unpacking automake (1:1.18.1-2) ... 152s Selecting previously unselected package autopoint. 152s Preparing to unpack .../06-autopoint_0.23.2-1_all.deb ... 152s Unpacking autopoint (0.23.2-1) ... 152s Selecting previously unselected package libc-dev-bin. 152s Preparing to unpack .../07-libc-dev-bin_2.42-2ubuntu2_armhf.deb ... 152s Unpacking libc-dev-bin (2.42-2ubuntu2) ... 152s Selecting previously unselected package linux-libc-dev:armhf. 152s Preparing to unpack .../08-linux-libc-dev_6.17.0-5.5_armhf.deb ... 152s Unpacking linux-libc-dev:armhf (6.17.0-5.5) ... 152s Selecting previously unselected package libcrypt-dev:armhf. 152s Preparing to unpack .../09-libcrypt-dev_1%3a4.4.38-1build1_armhf.deb ... 152s Unpacking libcrypt-dev:armhf (1:4.4.38-1build1) ... 152s Selecting previously unselected package rpcsvc-proto. 152s Preparing to unpack .../10-rpcsvc-proto_1.4.3-1_armhf.deb ... 152s Unpacking rpcsvc-proto (1.4.3-1) ... 152s Selecting previously unselected package libc6-dev:armhf. 152s Preparing to unpack .../11-libc6-dev_2.42-2ubuntu2_armhf.deb ... 152s Unpacking libc6-dev:armhf (2.42-2ubuntu2) ... 152s Selecting previously unselected package libisl23:armhf. 152s Preparing to unpack .../12-libisl23_0.27-1_armhf.deb ... 152s Unpacking libisl23:armhf (0.27-1) ... 152s Selecting previously unselected package libmpc3:armhf. 152s Preparing to unpack .../13-libmpc3_1.3.1-2_armhf.deb ... 152s Unpacking libmpc3:armhf (1.3.1-2) ... 152s Selecting previously unselected package cpp-15-arm-linux-gnueabihf. 152s Preparing to unpack .../14-cpp-15-arm-linux-gnueabihf_15.2.0-7ubuntu1_armhf.deb ... 152s Unpacking cpp-15-arm-linux-gnueabihf (15.2.0-7ubuntu1) ... 152s Selecting previously unselected package cpp-15. 152s Preparing to unpack .../15-cpp-15_15.2.0-7ubuntu1_armhf.deb ... 152s Unpacking cpp-15 (15.2.0-7ubuntu1) ... 152s Selecting previously unselected package cpp-arm-linux-gnueabihf. 152s Preparing to unpack .../16-cpp-arm-linux-gnueabihf_4%3a15.2.0-4ubuntu1_armhf.deb ... 152s Unpacking cpp-arm-linux-gnueabihf (4:15.2.0-4ubuntu1) ... 152s Selecting previously unselected package cpp. 152s Preparing to unpack .../17-cpp_4%3a15.2.0-4ubuntu1_armhf.deb ... 152s Unpacking cpp (4:15.2.0-4ubuntu1) ... 152s Selecting previously unselected package libcc1-0:armhf. 152s Preparing to unpack .../18-libcc1-0_15.2.0-7ubuntu1_armhf.deb ... 152s Unpacking libcc1-0:armhf (15.2.0-7ubuntu1) ... 152s Selecting previously unselected package libgomp1:armhf. 152s Preparing to unpack .../19-libgomp1_15.2.0-7ubuntu1_armhf.deb ... 152s Unpacking libgomp1:armhf (15.2.0-7ubuntu1) ... 153s Selecting previously unselected package libasan8:armhf. 153s Preparing to unpack .../20-libasan8_15.2.0-7ubuntu1_armhf.deb ... 153s Unpacking libasan8:armhf (15.2.0-7ubuntu1) ... 153s Selecting previously unselected package libubsan1:armhf. 153s Preparing to unpack .../21-libubsan1_15.2.0-7ubuntu1_armhf.deb ... 153s Unpacking libubsan1:armhf (15.2.0-7ubuntu1) ... 153s Selecting previously unselected package libgcc-15-dev:armhf. 153s Preparing to unpack .../22-libgcc-15-dev_15.2.0-7ubuntu1_armhf.deb ... 153s Unpacking libgcc-15-dev:armhf (15.2.0-7ubuntu1) ... 153s Selecting previously unselected package gcc-15-arm-linux-gnueabihf. 153s Preparing to unpack .../23-gcc-15-arm-linux-gnueabihf_15.2.0-7ubuntu1_armhf.deb ... 153s Unpacking gcc-15-arm-linux-gnueabihf (15.2.0-7ubuntu1) ... 153s Selecting previously unselected package gcc-15. 153s Preparing to unpack .../24-gcc-15_15.2.0-7ubuntu1_armhf.deb ... 153s Unpacking gcc-15 (15.2.0-7ubuntu1) ... 153s Selecting previously unselected package gcc-arm-linux-gnueabihf. 153s Preparing to unpack .../25-gcc-arm-linux-gnueabihf_4%3a15.2.0-4ubuntu1_armhf.deb ... 153s Unpacking gcc-arm-linux-gnueabihf (4:15.2.0-4ubuntu1) ... 153s Selecting previously unselected package gcc. 153s Preparing to unpack .../26-gcc_4%3a15.2.0-4ubuntu1_armhf.deb ... 153s Unpacking gcc (4:15.2.0-4ubuntu1) ... 153s Selecting previously unselected package libstdc++-15-dev:armhf. 153s Preparing to unpack .../27-libstdc++-15-dev_15.2.0-7ubuntu1_armhf.deb ... 153s Unpacking libstdc++-15-dev:armhf (15.2.0-7ubuntu1) ... 153s Selecting previously unselected package g++-15-arm-linux-gnueabihf. 153s Preparing to unpack .../28-g++-15-arm-linux-gnueabihf_15.2.0-7ubuntu1_armhf.deb ... 153s Unpacking g++-15-arm-linux-gnueabihf (15.2.0-7ubuntu1) ... 154s Selecting previously unselected package g++-15. 154s Preparing to unpack .../29-g++-15_15.2.0-7ubuntu1_armhf.deb ... 154s Unpacking g++-15 (15.2.0-7ubuntu1) ... 154s Selecting previously unselected package g++-arm-linux-gnueabihf. 154s Preparing to unpack .../30-g++-arm-linux-gnueabihf_4%3a15.2.0-4ubuntu1_armhf.deb ... 154s Unpacking g++-arm-linux-gnueabihf (4:15.2.0-4ubuntu1) ... 154s Selecting previously unselected package g++. 154s Preparing to unpack .../31-g++_4%3a15.2.0-4ubuntu1_armhf.deb ... 154s Unpacking g++ (4:15.2.0-4ubuntu1) ... 154s Selecting previously unselected package build-essential. 154s Preparing to unpack .../32-build-essential_12.12ubuntu1_armhf.deb ... 154s Unpacking build-essential (12.12ubuntu1) ... 154s Selecting previously unselected package libdebhelper-perl. 154s Preparing to unpack .../33-libdebhelper-perl_13.24.2ubuntu1_all.deb ... 154s Unpacking libdebhelper-perl (13.24.2ubuntu1) ... 154s Selecting previously unselected package libtool. 154s Preparing to unpack .../34-libtool_2.5.4-7_all.deb ... 154s Unpacking libtool (2.5.4-7) ... 154s Selecting previously unselected package dh-autoreconf. 154s Preparing to unpack .../35-dh-autoreconf_21_all.deb ... 154s Unpacking dh-autoreconf (21) ... 154s Selecting previously unselected package libarchive-zip-perl. 154s Preparing to unpack .../36-libarchive-zip-perl_1.68-1_all.deb ... 154s Unpacking libarchive-zip-perl (1.68-1) ... 154s Selecting previously unselected package libfile-stripnondeterminism-perl. 154s Preparing to unpack .../37-libfile-stripnondeterminism-perl_1.15.0-1_all.deb ... 154s Unpacking libfile-stripnondeterminism-perl (1.15.0-1) ... 154s Selecting previously unselected package dh-strip-nondeterminism. 154s Preparing to unpack .../38-dh-strip-nondeterminism_1.15.0-1_all.deb ... 154s Unpacking dh-strip-nondeterminism (1.15.0-1) ... 154s Selecting previously unselected package libdw1t64:armhf. 154s Preparing to unpack .../39-libdw1t64_0.194-1_armhf.deb ... 154s Unpacking libdw1t64:armhf (0.194-1) ... 154s Selecting previously unselected package debugedit. 154s Preparing to unpack .../40-debugedit_1%3a5.2-3_armhf.deb ... 154s Unpacking debugedit (1:5.2-3) ... 154s Selecting previously unselected package dwz. 154s Preparing to unpack .../41-dwz_0.16-2_armhf.deb ... 154s Unpacking dwz (0.16-2) ... 154s Selecting previously unselected package gettext. 154s Preparing to unpack .../42-gettext_0.23.2-1_armhf.deb ... 154s Unpacking gettext (0.23.2-1) ... 154s Selecting previously unselected package intltool-debian. 154s Preparing to unpack .../43-intltool-debian_0.35.0+20060710.6_all.deb ... 154s Unpacking intltool-debian (0.35.0+20060710.6) ... 154s Selecting previously unselected package po-debconf. 154s Preparing to unpack .../44-po-debconf_1.0.21+nmu1_all.deb ... 154s Unpacking po-debconf (1.0.21+nmu1) ... 154s Selecting previously unselected package debhelper. 154s Preparing to unpack .../45-debhelper_13.24.2ubuntu1_all.deb ... 154s Unpacking debhelper (13.24.2ubuntu1) ... 154s Selecting previously unselected package dh-python. 154s Preparing to unpack .../46-dh-python_6.20250414_all.deb ... 154s Unpacking dh-python (6.20250414) ... 154s Selecting previously unselected package libpython3.14-stdlib:armhf. 154s Preparing to unpack .../47-libpython3.14-stdlib_3.14.0-4_armhf.deb ... 154s Unpacking libpython3.14-stdlib:armhf (3.14.0-4) ... 155s Selecting previously unselected package pybuild-plugin-autopkgtest. 155s Preparing to unpack .../48-pybuild-plugin-autopkgtest_6.20250414_all.deb ... 155s Unpacking pybuild-plugin-autopkgtest (6.20250414) ... 155s Selecting previously unselected package python3-pyproject-hooks. 155s Preparing to unpack .../49-python3-pyproject-hooks_1.2.0-1_all.deb ... 155s Unpacking python3-pyproject-hooks (1.2.0-1) ... 155s Selecting previously unselected package python3-wheel. 155s Preparing to unpack .../50-python3-wheel_0.46.1-2_all.deb ... 155s Unpacking python3-wheel (0.46.1-2) ... 155s Selecting previously unselected package python3-build. 155s Preparing to unpack .../51-python3-build_1.2.2-4_all.deb ... 155s Unpacking python3-build (1.2.2-4) ... 155s Selecting previously unselected package python3-installer. 155s Preparing to unpack .../52-python3-installer_0.7.0+dfsg1-3_all.deb ... 155s Unpacking python3-installer (0.7.0+dfsg1-3) ... 155s Selecting previously unselected package pybuild-plugin-pyproject. 155s Preparing to unpack .../53-pybuild-plugin-pyproject_6.20250414_all.deb ... 155s Unpacking pybuild-plugin-pyproject (6.20250414) ... 155s Selecting previously unselected package python3.14. 155s Preparing to unpack .../54-python3.14_3.14.0-4_armhf.deb ... 155s Unpacking python3.14 (3.14.0-4) ... 155s Selecting previously unselected package python3-all. 155s Preparing to unpack .../55-python3-all_3.13.7-2_armhf.deb ... 155s Unpacking python3-all (3.13.7-2) ... 155s Selecting previously unselected package python3-astroid. 155s Preparing to unpack .../56-python3-astroid_3.3.8-2_all.deb ... 155s Unpacking python3-astroid (3.3.8-2) ... 155s Selecting previously unselected package python3-iniconfig. 155s Preparing to unpack .../57-python3-iniconfig_2.1.0-1_all.deb ... 155s Unpacking python3-iniconfig (2.1.0-1) ... 155s Selecting previously unselected package python3-lazy-object-proxy. 155s Preparing to unpack .../58-python3-lazy-object-proxy_1.12.0-1_armhf.deb ... 155s Unpacking python3-lazy-object-proxy (1.12.0-1) ... 155s Selecting previously unselected package python3-pip. 155s Preparing to unpack .../59-python3-pip_25.1.1+dfsg-1ubuntu2_all.deb ... 155s Unpacking python3-pip (25.1.1+dfsg-1ubuntu2) ... 155s Selecting previously unselected package python3-pluggy. 155s Preparing to unpack .../60-python3-pluggy_1.6.0-1_all.deb ... 155s Unpacking python3-pluggy (1.6.0-1) ... 155s Selecting previously unselected package python3-pytest. 155s Preparing to unpack .../61-python3-pytest_8.3.5-2_all.deb ... 155s Unpacking python3-pytest (8.3.5-2) ... 155s Selecting previously unselected package python3-pytest-runner. 155s Preparing to unpack .../62-python3-pytest-runner_2.11.1-5_all.deb ... 155s Unpacking python3-pytest-runner (2.11.1-5) ... 155s Selecting previously unselected package python3-wrapt. 155s Preparing to unpack .../63-python3-wrapt_1.17.3-2_armhf.deb ... 155s Unpacking python3-wrapt (1.17.3-2) ... 155s Setting up dh-python (6.20250414) ... 155s Setting up python3-iniconfig (2.1.0-1) ... 156s Setting up libarchive-zip-perl (1.68-1) ... 156s Setting up libdebhelper-perl (13.24.2ubuntu1) ... 156s Setting up libpython3.14-minimal:armhf (3.14.0-4) ... 156s Setting up linux-libc-dev:armhf (6.17.0-5.5) ... 156s Setting up m4 (1.4.20-2) ... 156s Setting up libgomp1:armhf (15.2.0-7ubuntu1) ... 156s Setting up python3-wheel (0.46.1-2) ... 156s Setting up libdw1t64:armhf (0.194-1) ... 156s Setting up autotools-dev (20240727.1) ... 156s Setting up rpcsvc-proto (1.4.3-1) ... 156s Setting up python3-pyproject-hooks (1.2.0-1) ... 157s Setting up libmpc3:armhf (1.3.1-2) ... 157s Setting up python3-wrapt (1.17.3-2) ... 157s Setting up autopoint (0.23.2-1) ... 157s Setting up python3-pip (25.1.1+dfsg-1ubuntu2) ... 159s Setting up python3-installer (0.7.0+dfsg1-3) ... 159s Setting up autoconf (2.72-3.1ubuntu1) ... 159s Setting up python3-pluggy (1.6.0-1) ... 159s Setting up libubsan1:armhf (15.2.0-7ubuntu1) ... 159s Setting up dwz (0.16-2) ... 159s Setting up python3-astroid (3.3.8-2) ... 160s Setting up libcrypt-dev:armhf (1:4.4.38-1build1) ... 160s Setting up libasan8:armhf (15.2.0-7ubuntu1) ... 160s Setting up debugedit (1:5.2-3) ... 160s Setting up python3-pytest-runner (2.11.1-5) ... 160s Setting up python3-lazy-object-proxy (1.12.0-1) ... 161s Setting up libisl23:armhf (0.27-1) ... 161s Setting up python3-build (1.2.2-4) ... 161s Setting up libc-dev-bin (2.42-2ubuntu2) ... 161s Setting up cpp-15-arm-linux-gnueabihf (15.2.0-7ubuntu1) ... 161s Setting up python3.14-minimal (3.14.0-4) ... 162s Setting up libcc1-0:armhf (15.2.0-7ubuntu1) ... 162s Setting up cpp-arm-linux-gnueabihf (4:15.2.0-4ubuntu1) ... 162s Setting up automake (1:1.18.1-2) ... 162s update-alternatives: using /usr/bin/automake-1.18 to provide /usr/bin/automake (automake) in auto mode 162s Setting up libfile-stripnondeterminism-perl (1.15.0-1) ... 162s Setting up gettext (0.23.2-1) ... 162s Setting up libgcc-15-dev:armhf (15.2.0-7ubuntu1) ... 162s Setting up gcc-15-arm-linux-gnueabihf (15.2.0-7ubuntu1) ... 162s Setting up libpython3.14-stdlib:armhf (3.14.0-4) ... 162s Setting up pybuild-plugin-pyproject (6.20250414) ... 162s Setting up python3-pytest (8.3.5-2) ... 163s Setting up intltool-debian (0.35.0+20060710.6) ... 163s Setting up dh-strip-nondeterminism (1.15.0-1) ... 163s Setting up cpp-15 (15.2.0-7ubuntu1) ... 163s Setting up cpp (4:15.2.0-4ubuntu1) ... 163s Setting up libc6-dev:armhf (2.42-2ubuntu2) ... 163s Setting up python3.14 (3.14.0-4) ... 164s Setting up gcc-arm-linux-gnueabihf (4:15.2.0-4ubuntu1) ... 164s Setting up po-debconf (1.0.21+nmu1) ... 164s Setting up python3-all (3.13.7-2) ... 164s Setting up gcc-15 (15.2.0-7ubuntu1) ... 164s Setting up libstdc++-15-dev:armhf (15.2.0-7ubuntu1) ... 164s Setting up libtool (2.5.4-7) ... 164s Setting up g++-15-arm-linux-gnueabihf (15.2.0-7ubuntu1) ... 164s Setting up gcc (4:15.2.0-4ubuntu1) ... 164s Setting up dh-autoreconf (21) ... 164s Setting up g++-15 (15.2.0-7ubuntu1) ... 164s Setting up g++-arm-linux-gnueabihf (4:15.2.0-4ubuntu1) ... 164s Setting up debhelper (13.24.2ubuntu1) ... 164s Setting up g++ (4:15.2.0-4ubuntu1) ... 164s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 164s Setting up build-essential (12.12ubuntu1) ... 164s Setting up pybuild-plugin-autopkgtest (6.20250414) ... 164s Processing triggers for man-db (2.13.1-1) ... 165s Processing triggers for install-info (7.2-5) ... 165s Processing triggers for libc-bin (2.42-2ubuntu2) ... 166s Processing triggers for systemd (257.9-0ubuntu2) ... 174s autopkgtest [11:44:55]: test pybuild-autopkgtest: pybuild-autopkgtest 174s autopkgtest [11:44:55]: test pybuild-autopkgtest: [----------------------- 176s pybuild-autopkgtest 176s I: pybuild base:311: cd /tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build; python3.14 -m pytest tests 179s ============================= test session starts ============================== 179s platform linux -- Python 3.14.0, pytest-8.3.5, pluggy-1.6.0 179s rootdir: /tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build 179s configfile: pyproject.toml 179s plugins: typeguard-4.4.2 179s collected 1708 items 179s 179s tests/brain/numpy/test_core_einsumfunc.py ss [ 0%] 179s tests/brain/numpy/test_core_fromnumeric.py s [ 0%] 179s tests/brain/numpy/test_core_function_base.py s [ 0%] 179s tests/brain/numpy/test_core_multiarray.py sssss [ 0%] 179s tests/brain/numpy/test_core_numeric.py sssss [ 0%] 179s tests/brain/numpy/test_core_numerictypes.py sssssss.. [ 1%] 179s tests/brain/numpy/test_core_umath.py ssssssss [ 1%] 179s tests/brain/numpy/test_ma.py ssss [ 2%] 179s tests/brain/numpy/test_ndarray.py sss [ 2%] 179s tests/brain/numpy/test_random_mtrand.py ss [ 2%] 179s tests/brain/test_argparse.py . [ 2%] 180s tests/brain/test_attr.py ....... [ 2%] 181s tests/brain/test_brain.py ......s.....ss......F......................... [ 5%] 181s ..........F.s.........................................................x. [ 9%] 182s ..............s...... [ 10%] 182s tests/brain/test_builtin.py .................. [ 12%] 182s tests/brain/test_ctypes.py ....x........................ [ 13%] 182s tests/brain/test_dataclasses.py ........................................ [ 16%] 182s ......................................x... [ 18%] 182s tests/brain/test_dateutil.py . [ 18%] 182s tests/brain/test_enum.py ............................. [ 20%] 182s tests/brain/test_hashlib.py ... [ 20%] 182s tests/brain/test_multiprocessing.py ... [ 20%] 182s tests/brain/test_named_tuple.py ....................... [ 21%] 182s tests/brain/test_nose.py s [ 22%] 182s tests/brain/test_pathlib.py FF.. [ 22%] 182s tests/brain/test_pytest.py . [ 22%] 182s tests/brain/test_qt.py sss [ 22%] 182s tests/brain/test_regex.py ss [ 22%] 182s tests/brain/test_signal.py ... [ 22%] 184s tests/brain/test_six.py ....... [ 23%] 184s tests/brain/test_ssl.py .. [ 23%] 184s tests/brain/test_threading.py .... [ 23%] 184s tests/brain/test_typing.py ..... [ 23%] 185s tests/brain/test_typing_extensions.py . [ 23%] 185s tests/brain/test_unittest.py . [ 23%] 186s tests/test_builder.py ...........................................FFFFFFF [ 26%] 187s FFFF.... [ 27%] 187s tests/test_constraint.py ................................... [ 29%] 187s tests/test_decorators.py ... [ 29%] 187s tests/test_filter_statements.py . [ 29%] 187s tests/test_group_exceptions.py ... [ 29%] 187s tests/test_helpers.py ............... [ 30%] 187s tests/test_inference.py ............................................F... [ 33%] 187s ............................................x...........x......x........ [ 37%] 188s ..................................................x..................... [ 41%] 188s ........................................................................ [ 46%] 189s ................................................x........xx............. [ 50%] 189s ........x...x................................................x.......... [ 54%] 189s ................................. [ 56%] 189s tests/test_inference_calls.py ........................ [ 57%] 191s tests/test_lookup.py FFFFFFFFFFFFFFFFFFFFFFFFFFFF....................... [ 60%] 191s .... [ 61%] 207s tests/test_manager.py .....................................s....... [ 63%] 207s tests/test_modutils.py ................................................. [ 66%] 207s ................s. [ 67%] 208s tests/test_nodes.py ............F................FFFFFFFFF.............. [ 70%] 208s ........................................................................ [ 74%] 208s ................................................................ [ 78%] 208s tests/test_nodes_lineno.py ....................... [ 80%] 208s tests/test_nodes_position.py ... [ 80%] 209s tests/test_object_model.py x...............x.........s........... [ 82%] 210s tests/test_objects.py ...................... [ 83%] 210s tests/test_protocols.py ..................... [ 84%] 210s tests/test_python3.py .......................... [ 86%] 210s tests/test_raw_building.py ............. [ 87%] 218s tests/test_regrtest.py .............ss............ [ 88%] 221s tests/test_scoped_nodes.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 91%] 227s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 95%] 229s FFFFFFFFFFFFFFFF.................................. [ 98%] 229s tests/test_stdlib.py .. [ 98%] 229s tests/test_transforms.py ......... [ 99%] 229s tests/test_type_params.py ..... [ 99%] 229s tests/test_utils.py ........ [100%] 229s 229s =================================== FAILURES =================================== 229s _______________________ TypingBrain.test_has_dunder_args _______________________ 229s 229s self = 229s 229s def test_has_dunder_args(self) -> None: 229s ast_node = builder.extract_node( 229s """ 229s from typing import Union 229s NumericTypes = Union[int, float] 229s NumericTypes.__args__ #@ 229s """ 229s ) 229s inferred = next(ast_node.infer()) 229s > assert isinstance(inferred, nodes.Tuple) 229s E AssertionError: assert False 229s E + where False = isinstance(Uninferable, ) 229s E + where = nodes.Tuple 229s 229s tests/brain/test_brain.py:747: AssertionError 229s ________________________ TypingBrain.test_typing_types _________________________ 229s 229s self = 229s 229s def test_typing_types(self) -> None: 229s ast_nodes = builder.extract_node( 229s """ 229s from typing import TypeVar, Iterable, Tuple, NewType, Dict, Union 229s TypeVar('MyTypeVar', int, float, complex) #@ 229s Iterable[Tuple[MyTypeVar, MyTypeVar]] #@ 229s TypeVar('AnyStr', str, bytes) #@ 229s NewType('UserId', str) #@ 229s Dict[str, str] #@ 229s Union[int, str] #@ 229s """ 229s ) 229s for node in ast_nodes: 229s inferred = next(node.infer()) 229s > self.assertIsInstance(inferred, nodes.ClassDef, node.as_string()) 229s E AssertionError: Uninferable is not an instance of : Union[int, str] 229s 229s tests/brain/test_brain.py:561: AssertionError 229s ____________________________ test_inference_parents ____________________________ 229s 229s def test_inference_parents() -> None: 229s """Test inference of ``pathlib.Path.parents``.""" 229s name_node = astroid.extract_node( 229s """ 229s from pathlib import Path 229s 229s current_path = Path().resolve() 229s path_parents = current_path.parents 229s path_parents 229s """ 229s ) 229s inferred = name_node.inferred() 229s assert len(inferred) == 1 229s assert isinstance(inferred[0], bases.Instance) 229s if PY313_PLUS: 229s > assert inferred[0].qname() == "builtins.tuple" 229s E AssertionError: assert 'pathlib._PathParents' == 'builtins.tuple' 229s E 229s E - builtins.tuple 229s E + pathlib._PathParents 229s 229s tests/brain/test_pathlib.py:27: AssertionError 229s ____________________ test_inference_parents_subscript_index ____________________ 229s 229s def test_inference_parents_subscript_index() -> None: 229s """Test inference of ``pathlib.Path.parents``, accessed by index.""" 229s path = astroid.extract_node( 229s """ 229s from pathlib import Path 229s 229s current_path = Path().resolve() 229s current_path.parents[2] #@ 229s """ 229s ) 229s 229s inferred = path.inferred() 229s assert len(inferred) == 1 229s assert isinstance(inferred[0], bases.Instance) 229s if PY313_PLUS: 229s > assert inferred[0].qname() == "pathlib._local.Path" 229s E AssertionError: assert 'builtins.tuple' == 'pathlib._local.Path' 229s E 229s E - pathlib._local.Path 229s E + builtins.tuple 229s 229s tests/brain/test_pathlib.py:47: AssertionError 229s _____________________ FileBuildTest.test_class_base_props ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ FileBuildTest.test_class_basenames ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ FileBuildTest.test_class_instance_attrs ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ FileBuildTest.test_class_locals ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ FileBuildTest.test_function_base_props ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ FileBuildTest.test_function_locals ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FileBuildTest.test_method_base_props _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ FileBuildTest.test_method_locals _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FileBuildTest.test_module_base_props _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ FileBuildTest.test_module_locals _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FileBuildTest.test_unknown_encoding ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_builder.py:752: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ InferenceTest.test_binary_op_or_union_type __________________ 229s 229s self = 229s 229s def test_binary_op_or_union_type(self) -> None: 229s """Binary or union is only defined for Python 3.10+.""" 229s code = """ 229s class A: ... 229s 229s int | 2 #@ 229s int | "Hello" #@ 229s int | ... #@ 229s int | A() #@ 229s int | None | 2 #@ 229s """ 229s ast_nodes = extract_node(code) 229s for n in ast_nodes: 229s assert n.inferred() == [util.Uninferable] 229s 229s code = """ 229s from typing import List 229s 229s class A: ... 229s class B: ... 229s 229s int | None #@ 229s int | str #@ 229s int | str | None #@ 229s A | B #@ 229s A | None #@ 229s List[int] | int #@ 229s tuple | int #@ 229s """ 229s ast_nodes = extract_node(code) 229s if not PY310_PLUS: 229s for n in ast_nodes: 229s assert n.inferred() == [util.Uninferable] 229s else: 229s i0 = ast_nodes[0].inferred()[0] 229s assert isinstance(i0, UnionType) 229s assert isinstance(i0.left, nodes.ClassDef) 229s assert i0.left.name == "int" 229s assert isinstance(i0.right, nodes.Const) 229s assert i0.right.value is None 229s 229s # Assert basic UnionType properties and methods 229s assert i0.callable() is False 229s assert i0.bool_value() is True 229s assert i0.pytype() == "types.UnionType" 229s assert i0.display_type() == "UnionType" 229s > assert str(i0) == "UnionType(UnionType)" 229s E AssertionError: assert 'UnionType(Union)' == 'UnionType(UnionType)' 229s E 229s E - UnionType(UnionType) 229s E ? ---- 229s E + UnionType(Union) 229s 229s tests/test_inference.py:1309: AssertionError 229s ________________________ LookupTest.test_builtin_lookup ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________________ LookupTest.test_class _____________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ LookupTest.test_class_ancestor_name ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ LookupTest.test_class_in_function _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ LookupTest.test_class_variables ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ LookupTest.test_decorator_arguments_lookup __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ LookupTest.test_dict_comp_nested _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________________ LookupTest.test_dict_comps __________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ LookupTest.test_explicit___name__ _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ LookupTest.test_function_argument_with_default ________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ LookupTest.test_function_module_special ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ LookupTest.test_function_nested ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ LookupTest.test_generator_attributes _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ LookupTest.test_global_delete _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ LookupTest.test_inner_classes _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ LookupTest.test_inner_decorator_member_lookup _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ LookupTest.test_lambda_nested _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________________ LookupTest.test_limit _____________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ LookupTest.test_list_comp_nested _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ LookupTest.test_list_comp_target _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________________ LookupTest.test_list_comps __________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ LookupTest.test_loopvar_hiding ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________________ LookupTest.test_method ____________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________________ LookupTest.test_module ____________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ LookupTest.test_set_comp_closure _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ LookupTest.test_set_comp_nested ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________________ LookupTest.test_set_comps ___________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ LookupTest.test_static_method_lookup _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_lookup.py:22: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ AsStringTest.test_module_as_string ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def test_module_as_string(self) -> None: 229s """Check as_string on a whole module prepared to be returned identically.""" 229s > module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:114: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ ImportNodeTest.test_absolute_import ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ ImportNodeTest.test_as_string _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ImportNodeTest.test_bad_import_inference ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ImportNodeTest.test_conditional ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ImportNodeTest.test_conditional_import ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ImportNodeTest.test_from_self_resolve _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ImportNodeTest.test_import_self_resolve ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ImportNodeTest.test_more_absolute_import ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ ImportNodeTest.test_real_name _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_nodes.py:481: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ModuleNodeTest.test_comment_before_docstring _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ ModuleNodeTest.test_dict_interface ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ ModuleNodeTest.test_file_stream_api ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ ModuleNodeTest.test_file_stream_in_memory ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ModuleNodeTest.test_file_stream_physical ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________________ ModuleNodeTest.test_getattr __________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________________ ModuleNodeTest.test_import_1 _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________________ ModuleNodeTest.test_import_2 _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ ModuleNodeTest.test_import_unavailable_module _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ ModuleNodeTest.test_module_getattr ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ModuleNodeTest.test_multiline_docstring ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ModuleNodeTest.test_public_names _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ ModuleNodeTest.test_relative_to_absolute_name _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________ ModuleNodeTest.test_relative_to_absolute_name_beyond_top_level ________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ModuleNodeTest.test_singleline_docstring ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ModuleNodeTest.test_special_attributes ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ ModuleNodeTest.test_stream_api ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ ModuleNodeTest.test_wildcard_import_names ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ModuleNodeTest.test_without_docstring _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________ FunctionNodeTest.test_abstract_methods_are_not_implicitly_none ________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ FunctionNodeTest.test_argnames ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ FunctionNodeTest.test_argnames_lambda _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________ FunctionNodeTest.test_decorator_builtin_descriptors ______________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FunctionNodeTest.test_default_value ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FunctionNodeTest.test_dict_interface _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ FunctionNodeTest.test_display_type ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ FunctionNodeTest.test_docstring_special_cases _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________ FunctionNodeTest.test_dunder_class_local_to_classmethod ____________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________ FunctionNodeTest.test_dunder_class_local_to_function _____________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________ FunctionNodeTest.test_dunder_class_local_to_method ______________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ FunctionNodeTest.test_format_args _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________ FunctionNodeTest.test_format_args_keyword_only_args ______________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ FunctionNodeTest.test_four_args ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ FunctionNodeTest.test_func_instance_attr ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FunctionNodeTest.test_func_is_bound ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ FunctionNodeTest.test_igetattr ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ FunctionNodeTest.test_inference_error _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ FunctionNodeTest.test_is_abstract _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ FunctionNodeTest.test_is_abstract_decorated __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ FunctionNodeTest.test_is_generator ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ FunctionNodeTest.test_is_method ________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FunctionNodeTest.test_lambda_getattr _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FunctionNodeTest.test_lambda_pytype ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ FunctionNodeTest.test_lambda_qname ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ FunctionNodeTest.test_method_init_subclass __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ FunctionNodeTest.test_multiline_docstring ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________ FunctionNodeTest.test_multiline_docstring_async ________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ FunctionNodeTest.test_navigation _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________ FunctionNodeTest.test_no_returns_is_implicitly_none ______________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________ FunctionNodeTest.test_only_raises_is_not_implicitly_none ___________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ FunctionNodeTest.test_positional_only_argnames ________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________ FunctionNodeTest.test_return_annotation_is_not_the_last ____________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ FunctionNodeTest.test_return_nothing _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ FunctionNodeTest.test_singleline_docstring __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ FunctionNodeTest.test_special_attributes ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________ FunctionNodeTest.test_type_builtin_descriptor_subclasses ___________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ FunctionNodeTest.test_without_docstring ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ ClassNodeTest.test__bases__attribute _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ ClassNodeTest.test__mro__attribute ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_add_metaclass _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_all_ancestors_need_slots __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________________ ClassNodeTest.test_ancestors _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ ClassNodeTest.test_class_extra_decorators ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________ ClassNodeTest.test_class_extra_decorators_frame_is_not_class _________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _ ClassNodeTest.test_class_extra_decorators_only_assignment_names_are_considered _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____ ClassNodeTest.test_class_extra_decorators_only_callfunc_are_considered ____ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____ ClassNodeTest.test_class_extra_decorators_only_same_name_considered ______ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_class_getattr _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ ClassNodeTest.test_class_keywords _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ ClassNodeTest.test_classmethod_attributes ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_cls_special_attributes_1 __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_cls_special_attributes_2 __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ ClassNodeTest.test_dict_interface _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ ClassNodeTest.test_duplicate_bases_namedtuple _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______ ClassNodeTest.test_extra_decorators_only_class_level_assignments _______ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________ ClassNodeTest.test_function_with_decorator_lineno _______________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________ ClassNodeTest.test_generator_from_infer_call_result_parent __________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ClassNodeTest.test_getattr_from_grandpa ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_getattr_method_transform __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________ ClassNodeTest.test_getattr_with_enpty_annassign ________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_has_dynamic_getattr ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_implicit_metaclass _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_implicit_metaclass_lookup _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_inner_classes _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ ClassNodeTest.test_instance_attr_ancestors __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________ ClassNodeTest.test_instance_bound_method_lambdas _______________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________ ClassNodeTest.test_instance_bound_method_lambdas_2 ______________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ ClassNodeTest.test_instance_getattr ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________ ClassNodeTest.test_instance_getattr_with_class_attr ______________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ ClassNodeTest.test_instance_special_attributes ________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ ClassNodeTest.test_kite_graph _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ClassNodeTest.test_local_attr_ancestors ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ ClassNodeTest.test_local_attr_invalid_mro ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ ClassNodeTest.test_local_attr_mro _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ ClassNodeTest.test_metaclass_error ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_metaclass_generator_hack __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________ ClassNodeTest.test_metaclass_generator_hack_enum_base _____________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ ClassNodeTest.test_metaclass_lookup ______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________ ClassNodeTest.test_metaclass_lookup_inference_errors _____________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________ ClassNodeTest.test_metaclass_lookup_using_same_class _____________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ______________________ ClassNodeTest.test_metaclass_type _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_metaclass_yes_leak _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________________ ClassNodeTest.test_methods __________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________________ ClassNodeTest.test_mro ____________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_mro_generic_1 _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_mro_generic_2 _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_mro_generic_3 _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_mro_generic_4 _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_mro_generic_5 _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_mro_generic_6 _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _______________________ ClassNodeTest.test_mro_generic_7 _______________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_mro_generic_error_1 ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_mro_generic_error_2 ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ClassNodeTest.test_mro_typing_extensions ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ ClassNodeTest.test_mro_with_attribute_classes _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_mro_with_factories _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_multiline_docstring ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________________ ClassNodeTest.test_navigation _________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ________________ ClassNodeTest.test_no_infinite_metaclass_loop _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________ ClassNodeTest.test_no_infinite_metaclass_loop_with_redefine __________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_nonregr_infer_callresult __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ClassNodeTest.test_singleline_docstring ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________________ ClassNodeTest.test_slots ___________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________ ClassNodeTest.test_slots_added_dynamically_still_inferred ___________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_slots_empty_list_of_slots _________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_slots_for_dict_keys ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _________________ ClassNodeTest.test_slots_taken_from_parents __________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________________ ClassNodeTest.test_type ____________________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________________ ClassNodeTest.test_type_three_arguments ____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ___________ ClassNodeTest.test_using_invalid_six_add_metaclass_call ____________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s __________________ ClassNodeTest.test_with_invalid_metaclass ___________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s ____________________ ClassNodeTest.test_with_metaclass_mro _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s _____________________ ClassNodeTest.test_without_docstring _____________________ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s > node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:181: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 229s parsed = parser_module.parse( 229s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 229s return ast.parse(string, filename=filename, type_comments=type_comments) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 229s filename = 'data.module', mode = 'exec' 229s 229s def parse(source, filename='', mode='exec', *, 229s type_comments=False, feature_version=None, optimize=-1): 229s """ 229s Parse the source into an AST node. 229s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 229s Pass type_comments=True to get back type comments where the syntax allows. 229s """ 229s flags = PyCF_ONLY_AST 229s if optimize > 0: 229s flags |= PyCF_OPTIMIZED_AST 229s if type_comments: 229s flags |= PyCF_TYPE_COMMENTS 229s if feature_version is None: 229s feature_version = -1 229s elif isinstance(feature_version, tuple): 229s major, minor = feature_version # Should be a 2-tuple. 229s if major != 3: 229s raise ValueError(f"Unsupported major version: {major}") 229s feature_version = minor 229s # Else it should be an int giving the minor version for 3.x. 229s > return compile(source, filename, mode, flags, 229s _feature_version=feature_version, optimize=optimize) 229s E File "data.module", line 62 229s E SyntaxError: 'return' in a 'finally' block 229s 229s /usr/lib/python3.14/ast.py:46: SyntaxError 229s 229s The above exception was the direct cause of the following exception: 229s 229s self = 229s 229s def setUp(self) -> None: 229s super().setUp() 229s > self.module = resources.build_file("data/module.py", "data.module") 229s 229s tests/test_scoped_nodes.py:73: 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s tests/resources.py:23: in build_file 229s return builder.AstroidBuilder().file_build(find(path), modname) 229s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 229s module, builder = self._data_build(data, modname, path) 229s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 229s 229s self = 229s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 229s modname = 'data.module' 229s path = '/tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 229s 229s def _data_build( 229s self, data: str, modname: str, path: str | None 229s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 229s """Build tree node from data and add some informations.""" 229s try: 229s node, parser_module = _parse_string( 229s data, type_comments=True, modname=modname 229s ) 229s except (TypeError, ValueError, SyntaxError) as exc: 229s > raise AstroidSyntaxError( 229s "Parsing Python code failed:\n{error}", 229s source=data, 229s modname=modname, 229s path=path, 229s error=exc, 229s ) from exc 229s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 229s E 'return' in a 'finally' block (data.module, line 62) 229s 229s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 229s =========================== short test summary info ============================ 229s FAILED tests/brain/test_brain.py::TypingBrain::test_has_dunder_args - Asserti... 229s FAILED tests/brain/test_brain.py::TypingBrain::test_typing_types - AssertionE... 229s FAILED tests/brain/test_pathlib.py::test_inference_parents - AssertionError: ... 229s FAILED tests/brain/test_pathlib.py::test_inference_parents_subscript_index - ... 229s FAILED tests/test_builder.py::FileBuildTest::test_class_base_props - astroid.... 229s FAILED tests/test_builder.py::FileBuildTest::test_class_basenames - astroid.e... 229s FAILED tests/test_builder.py::FileBuildTest::test_class_instance_attrs - astr... 229s FAILED tests/test_builder.py::FileBuildTest::test_class_locals - astroid.exce... 229s FAILED tests/test_builder.py::FileBuildTest::test_function_base_props - astro... 229s FAILED tests/test_builder.py::FileBuildTest::test_function_locals - astroid.e... 229s FAILED tests/test_builder.py::FileBuildTest::test_method_base_props - astroid... 229s FAILED tests/test_builder.py::FileBuildTest::test_method_locals - astroid.exc... 229s FAILED tests/test_builder.py::FileBuildTest::test_module_base_props - astroid... 229s FAILED tests/test_builder.py::FileBuildTest::test_module_locals - astroid.exc... 229s FAILED tests/test_builder.py::FileBuildTest::test_unknown_encoding - astroid.... 229s FAILED tests/test_inference.py::InferenceTest::test_binary_op_or_union_type 229s FAILED tests/test_lookup.py::LookupTest::test_builtin_lookup - astroid.except... 229s FAILED tests/test_lookup.py::LookupTest::test_class - astroid.exceptions.Astr... 229s FAILED tests/test_lookup.py::LookupTest::test_class_ancestor_name - astroid.e... 229s FAILED tests/test_lookup.py::LookupTest::test_class_in_function - astroid.exc... 229s FAILED tests/test_lookup.py::LookupTest::test_class_variables - astroid.excep... 229s FAILED tests/test_lookup.py::LookupTest::test_decorator_arguments_lookup - as... 229s FAILED tests/test_lookup.py::LookupTest::test_dict_comp_nested - astroid.exce... 229s FAILED tests/test_lookup.py::LookupTest::test_dict_comps - astroid.exceptions... 229s FAILED tests/test_lookup.py::LookupTest::test_explicit___name__ - astroid.exc... 229s FAILED tests/test_lookup.py::LookupTest::test_function_argument_with_default 229s FAILED tests/test_lookup.py::LookupTest::test_function_module_special - astro... 229s FAILED tests/test_lookup.py::LookupTest::test_function_nested - astroid.excep... 229s FAILED tests/test_lookup.py::LookupTest::test_generator_attributes - astroid.... 229s FAILED tests/test_lookup.py::LookupTest::test_global_delete - astroid.excepti... 229s FAILED tests/test_lookup.py::LookupTest::test_inner_classes - astroid.excepti... 229s FAILED tests/test_lookup.py::LookupTest::test_inner_decorator_member_lookup 229s FAILED tests/test_lookup.py::LookupTest::test_lambda_nested - astroid.excepti... 229s FAILED tests/test_lookup.py::LookupTest::test_limit - astroid.exceptions.Astr... 229s FAILED tests/test_lookup.py::LookupTest::test_list_comp_nested - astroid.exce... 229s FAILED tests/test_lookup.py::LookupTest::test_list_comp_target - astroid.exce... 229s FAILED tests/test_lookup.py::LookupTest::test_list_comps - astroid.exceptions... 229s FAILED tests/test_lookup.py::LookupTest::test_loopvar_hiding - astroid.except... 229s FAILED tests/test_lookup.py::LookupTest::test_method - astroid.exceptions.Ast... 229s FAILED tests/test_lookup.py::LookupTest::test_module - astroid.exceptions.Ast... 229s FAILED tests/test_lookup.py::LookupTest::test_set_comp_closure - astroid.exce... 229s FAILED tests/test_lookup.py::LookupTest::test_set_comp_nested - astroid.excep... 229s FAILED tests/test_lookup.py::LookupTest::test_set_comps - astroid.exceptions.... 229s FAILED tests/test_lookup.py::LookupTest::test_static_method_lookup - astroid.... 229s FAILED tests/test_nodes.py::AsStringTest::test_module_as_string - astroid.exc... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_absolute_import - astroid.ex... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_as_string - astroid.exceptio... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_bad_import_inference - astro... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_conditional - astroid.except... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_conditional_import - astroid... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_from_self_resolve - astroid.... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_import_self_resolve - astroi... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_more_absolute_import - astro... 229s FAILED tests/test_nodes.py::ImportNodeTest::test_real_name - astroid.exceptio... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_comment_before_docstring 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_dict_interface - astr... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_api - ast... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_in_memory 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_physical 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_getattr - astroid.exc... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_1 - astroid.ex... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_2 - astroid.ex... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_unavailable_module 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_module_getattr - astr... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_multiline_docstring 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_public_names - astroi... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_relative_to_absolute_name 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_relative_to_absolute_name_beyond_top_level 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_singleline_docstring 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_special_attributes - ... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_stream_api - astroid.... 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_wildcard_import_names 229s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_without_docstring - a... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_abstract_methods_are_not_implicitly_none 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_argnames - astroid.... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_argnames_lambda - a... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_decorator_builtin_descriptors 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_default_value - ast... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dict_interface - as... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_display_type - astr... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_docstring_special_cases 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_classmethod 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_function 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_method 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_format_args - astro... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_format_args_keyword_only_args 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_four_args - astroid... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_func_instance_attr 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_func_is_bound - ast... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_igetattr - astroid.... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_inference_error - a... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_abstract - astro... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_abstract_decorated 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_generator - astr... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_method - astroid... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_getattr - as... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_pytype - ast... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_qname - astr... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_method_init_subclass 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_multiline_docstring 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_multiline_docstring_async 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_navigation - astroi... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_no_returns_is_implicitly_none 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_only_raises_is_not_implicitly_none 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_positional_only_argnames 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_return_annotation_is_not_the_last 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_return_nothing - as... 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_singleline_docstring 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_special_attributes 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_type_builtin_descriptor_subclasses 229s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_without_docstring 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test__bases__attribute - as... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test__mro__attribute - astr... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_add_metaclass - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_all_ancestors_need_slots 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_ancestors - astroid.ex... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_frame_is_not_class 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_assignment_names_are_considered 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_callfunc_are_considered 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_same_name_considered 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_getattr - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_keywords - astro... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_classmethod_attributes 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_cls_special_attributes_1 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_cls_special_attributes_2 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_dict_interface - astro... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_duplicate_bases_namedtuple 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_extra_decorators_only_class_level_assignments 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_function_with_decorator_lineno 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_generator_from_infer_call_result_parent 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_from_grandpa 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_method_transform 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_with_enpty_annassign 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_has_dynamic_getattr - ... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_implicit_metaclass - a... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_implicit_metaclass_lookup 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_inner_classes - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_attr_ancestors 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_bound_method_lambdas 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_bound_method_lambdas_2 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_getattr - ast... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_getattr_with_class_attr 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_special_attributes 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_kite_graph - astroid.e... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_ancestors 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_invalid_mro 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_mro - astro... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_error - astr... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_generator_hack 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_generator_hack_enum_base 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup - ast... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup_inference_errors 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup_using_same_class 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_type - astro... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_yes_leak - a... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_methods - astroid.exce... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro - astroid.exceptio... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_1 - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_2 - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_3 - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_4 - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_5 - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_6 - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_7 - astroi... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_error_1 - ... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_error_2 - ... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_typing_extensions 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_with_attribute_classes 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_with_factories - a... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_multiline_docstring - ... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_navigation - astroid.e... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_no_infinite_metaclass_loop 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_no_infinite_metaclass_loop_with_redefine 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_nonregr_infer_callresult 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_singleline_docstring 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots - astroid.except... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_added_dynamically_still_inferred 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_empty_list_of_slots 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_for_dict_keys - ... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_taken_from_parents 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_type - astroid.excepti... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_type_three_arguments 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_using_invalid_six_add_metaclass_call 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_with_invalid_metaclass 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_with_metaclass_mro - a... 229s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_without_docstring - as... 229s ========== 187 failed, 1452 passed, 54 skipped, 15 xfailed in 52.73s =========== 231s E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build; python3.14 -m pytest tests 231s I: pybuild base:311: cd /tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build; python3.13 -m pytest tests 234s ============================= test session starts ============================== 234s platform linux -- Python 3.13.9, pytest-8.3.5, pluggy-1.6.0 234s rootdir: /tmp/autopkgtest.Ur6Rit/autopkgtest_tmp/build 234s configfile: pyproject.toml 234s plugins: typeguard-4.4.2 234s collected 1708 items 234s 234s tests/brain/numpy/test_core_einsumfunc.py ss [ 0%] 234s tests/brain/numpy/test_core_fromnumeric.py s [ 0%] 234s tests/brain/numpy/test_core_function_base.py s [ 0%] 234s tests/brain/numpy/test_core_multiarray.py sssss [ 0%] 234s tests/brain/numpy/test_core_numeric.py sssss [ 0%] 234s tests/brain/numpy/test_core_numerictypes.py sssssss.. [ 1%] 234s tests/brain/numpy/test_core_umath.py ssssssss [ 1%] 234s tests/brain/numpy/test_ma.py ssss [ 2%] 234s tests/brain/numpy/test_ndarray.py sss [ 2%] 234s tests/brain/numpy/test_random_mtrand.py ss [ 2%] 234s tests/brain/test_argparse.py . [ 2%] 234s tests/brain/test_attr.py ....... [ 2%] 235s tests/brain/test_brain.py ......s.....ss................................ [ 5%] 236s ............s.........................................................x. [ 9%] 236s ..............s...... [ 10%] 236s tests/brain/test_builtin.py .................. [ 12%] 236s tests/brain/test_ctypes.py ....x........................ [ 13%] 236s tests/brain/test_dataclasses.py ........................................ [ 16%] 237s ......................................x... [ 18%] 237s tests/brain/test_dateutil.py . [ 18%] 237s tests/brain/test_enum.py ............................. [ 20%] 237s tests/brain/test_hashlib.py ... [ 20%] 237s tests/brain/test_multiprocessing.py ... [ 20%] 237s tests/brain/test_named_tuple.py ....................... [ 21%] 237s tests/brain/test_nose.py s [ 22%] 237s tests/brain/test_pathlib.py .... [ 22%] 237s tests/brain/test_pytest.py . [ 22%] 237s tests/brain/test_qt.py sss [ 22%] 237s tests/brain/test_regex.py ss [ 22%] 238s tests/brain/test_signal.py ... [ 22%] 239s tests/brain/test_six.py ....... [ 23%] 239s tests/brain/test_ssl.py .. [ 23%] 239s tests/brain/test_threading.py .... [ 23%] 240s tests/brain/test_typing.py ..... [ 23%] 240s tests/brain/test_typing_extensions.py . [ 23%] 241s tests/brain/test_unittest.py . [ 23%] 242s tests/test_builder.py .................................................. [ 26%] 242s ........ [ 27%] 242s tests/test_constraint.py ................................... [ 29%] 242s tests/test_decorators.py ... [ 29%] 242s tests/test_filter_statements.py . [ 29%] 242s tests/test_group_exceptions.py ... [ 29%] 242s tests/test_helpers.py ............... [ 30%] 242s tests/test_inference.py ................................................ [ 33%] 243s ............................................x...........x......x........ [ 37%] 243s ..................................................x..................... [ 41%] 243s ........................................................................ [ 46%] 244s ................................................x........xx............. [ 50%] 244s ........x...x................................................x.......... [ 54%] 244s ................................. [ 56%] 244s tests/test_inference_calls.py ........................ [ 57%] 245s tests/test_lookup.py ................................................... [ 60%] 245s .... [ 61%] 261s tests/test_manager.py .....................................s....... [ 63%] 262s tests/test_modutils.py ................................................. [ 66%] 262s ................s. [ 67%] 263s tests/test_nodes.py .................................................... [ 70%] 263s ........................................................................ [ 74%] 263s ................................................................ [ 78%] 264s tests/test_nodes_lineno.py ....................... [ 80%] 264s tests/test_nodes_position.py ... [ 80%] 264s tests/test_object_model.py x...............x.........s........... [ 82%] 264s tests/test_objects.py ...................... [ 83%] 264s tests/test_protocols.py ..................... [ 84%] 264s tests/test_python3.py .......................... [ 86%] 265s tests/test_raw_building.py ............. [ 87%] 271s tests/test_regrtest.py .............ss............ [ 88%] 273s tests/test_scoped_nodes.py ............................................. [ 91%] 275s ........................................................................ [ 95%] 275s .................................................. [ 98%] 275s tests/test_stdlib.py .. [ 98%] 275s tests/test_transforms.py ......... [ 99%] 275s tests/test_type_params.py ..... [ 99%] 275s tests/test_utils.py ........ [100%] 275s 275s ================ 1639 passed, 54 skipped, 15 xfailed in 44.09s ================= 276s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p "3.14 3.13" returned exit code 13 276s make: *** [/tmp/Bs8zCVI9_V/run:4: pybuild-autopkgtest] Error 25 276s pybuild-autopkgtest: error: /tmp/Bs8zCVI9_V/run pybuild-autopkgtest returned exit code 2 277s autopkgtest [11:46:38]: test pybuild-autopkgtest: -----------------------] 281s pybuild-autopkgtest FAIL non-zero exit status 25 281s autopkgtest [11:46:42]: test pybuild-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 285s autopkgtest [11:46:46]: @@@@@@@@@@@@@@@@@@@@ summary 285s pybuild-autopkgtest FAIL non-zero exit status 25