0s autopkgtest [13:31:18]: starting date and time: 2025-11-17 13:31:18+0000 0s autopkgtest [13:31:18]: git checkout: 4b346b80 nova: make wait_reboot return success even when a no-op 0s autopkgtest [13:31:18]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.93tfg3_5/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --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 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@bos03-arm64-4.secgroup --name adt-resolute-arm64-astroid-20251117-133117-juju-7f2275-prod-proposed-migration-environment-15-934062a5-99eb-4bb5-95a4-ef9ed0f6ab0f --image adt/ubuntu-resolute-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration -e TERM=linux --mirror=http://ftpmaster.internal/ubuntu/ 3s Creating nova instance adt-resolute-arm64-astroid-20251117-133117-juju-7f2275-prod-proposed-migration-environment-15-934062a5-99eb-4bb5-95a4-ef9ed0f6ab0f from image adt/ubuntu-resolute-arm64-server-20251117.img (UUID 1cd33fbb-18df-4c5a-b8f0-2dcb25269485)... 57s autopkgtest [13:32:14]: testbed dpkg architecture: arm64 57s autopkgtest [13:32:15]: testbed apt version: 3.1.11 57s autopkgtest [13:32:15]: @@@@@@@@@@@@@@@@@@@@ test bed setup 57s autopkgtest [13:32:15]: testbed release detected to be: None 58s autopkgtest [13:32:16]: updating testbed package index (apt update) 58s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease [87.8 kB] 59s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 59s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 59s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 59s Get:5 http://ftpmaster.internal/ubuntu resolute-proposed/universe Sources [868 kB] 59s Get:6 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse Sources [22.9 kB] 59s Get:7 http://ftpmaster.internal/ubuntu resolute-proposed/restricted Sources [9848 B] 59s Get:8 http://ftpmaster.internal/ubuntu resolute-proposed/main Sources [81.1 kB] 59s Get:9 http://ftpmaster.internal/ubuntu resolute-proposed/main arm64 Packages [149 kB] 59s Get:10 http://ftpmaster.internal/ubuntu resolute-proposed/main arm64 c-n-f Metadata [3084 B] 59s Get:11 http://ftpmaster.internal/ubuntu resolute-proposed/restricted arm64 Packages [107 kB] 59s Get:12 http://ftpmaster.internal/ubuntu resolute-proposed/restricted arm64 c-n-f Metadata [324 B] 59s Get:13 http://ftpmaster.internal/ubuntu resolute-proposed/universe arm64 Packages [577 kB] 59s Get:14 http://ftpmaster.internal/ubuntu resolute-proposed/universe arm64 c-n-f Metadata [17.8 kB] 59s Get:15 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse arm64 Packages [12.5 kB] 59s Get:16 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse arm64 c-n-f Metadata [576 B] 60s Fetched 1938 kB in 1s (1628 kB/s) 61s Reading package lists... 62s Hit:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease 62s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 62s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 62s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 63s Reading package lists... 63s Reading package lists... 63s Building dependency tree... 63s Reading state information... 63s Calculating upgrade... 64s The following packages will be upgraded: 64s libpython3-stdlib python3 python3-minimal usbutils 64s 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 64s Need to get 144 kB of archives. 64s After this operation, 0 B of additional disk space will be used. 64s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed/main arm64 python3-minimal arm64 3.13.7-2 [27.8 kB] 64s Get:2 http://ftpmaster.internal/ubuntu resolute-proposed/main arm64 python3 arm64 3.13.7-2 [23.9 kB] 64s Get:3 http://ftpmaster.internal/ubuntu resolute-proposed/main arm64 libpython3-stdlib arm64 3.13.7-2 [10.6 kB] 64s Get:4 http://ftpmaster.internal/ubuntu resolute/main arm64 usbutils arm64 1:019-1 [81.7 kB] 65s dpkg-preconfigure: unable to re-open stdin: No such file or directory 65s Fetched 144 kB in 0s (349 kB/s) 65s (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 ... 88137 files and directories currently installed.) 65s Preparing to unpack .../python3-minimal_3.13.7-2_arm64.deb ... 65s Unpacking python3-minimal (3.13.7-2) over (3.13.7-1) ... 65s Setting up python3-minimal (3.13.7-2) ... 65s (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 ... 88137 files and directories currently installed.) 65s Preparing to unpack .../python3_3.13.7-2_arm64.deb ... 66s running python pre-rtupdate hooks for python3.13... 66s Unpacking python3 (3.13.7-2) over (3.13.7-1) ... 66s Preparing to unpack .../libpython3-stdlib_3.13.7-2_arm64.deb ... 66s Unpacking libpython3-stdlib:arm64 (3.13.7-2) over (3.13.7-1) ... 66s Preparing to unpack .../usbutils_1%3a019-1_arm64.deb ... 66s Unpacking usbutils (1:019-1) over (1:018-2) ... 66s Setting up usbutils (1:019-1) ... 66s Setting up libpython3-stdlib:arm64 (3.13.7-2) ... 66s Setting up python3 (3.13.7-2) ... 66s running python rtupdate hooks for python3.13... 66s running python post-rtupdate hooks for python3.13... 66s Processing triggers for man-db (2.13.1-1) ... 67s autopkgtest [13:32:25]: upgrading testbed (apt dist-upgrade and autopurge) 67s Reading package lists... 68s Building dependency tree... 68s Reading state information... 68s Calculating upgrade... 68s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 69s Reading package lists... 69s Building dependency tree... 69s Reading state information... 69s Solving dependencies... 69s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 72s autopkgtest [13:32:30]: testbed running kernel: Linux 6.17.0-5-generic #5-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 09:50:31 UTC 2025 72s autopkgtest [13:32:30]: @@@@@@@@@@@@@@@@@@@@ apt-source astroid 74s Get:1 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (dsc) [2268 B] 74s Get:2 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (tar) [467 kB] 74s Get:3 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (diff) [5604 B] 74s gpgv: Signature made Sun Jan 19 13:16:35 2025 UTC 74s gpgv: using RSA key 8F6DE104377F3B11E741748731F3144544A1741A 74s gpgv: issuer "tchet@debian.org" 74s gpgv: Can't check signature: No public key 74s dpkg-source: warning: cannot verify inline signature for ./astroid_3.3.8-2.dsc: no acceptable signature found 74s autopkgtest [13:32:32]: testing package astroid version 3.3.8-2 75s autopkgtest [13:32:33]: build not needed 75s autopkgtest [13:32:33]: test pybuild-autopkgtest: preparing testbed 76s Reading package lists... 76s Building dependency tree... 76s Reading state information... 77s Solving dependencies... 78s The following NEW packages will be installed: 78s autoconf automake autopoint autotools-dev build-essential cpp cpp-15 78s cpp-15-aarch64-linux-gnu cpp-aarch64-linux-gnu debhelper debugedit 78s dh-autoreconf dh-python dh-strip-nondeterminism dwz g++ g++-15 78s g++-15-aarch64-linux-gnu g++-aarch64-linux-gnu gcc gcc-15 78s gcc-15-aarch64-linux-gnu gcc-aarch64-linux-gnu gettext intltool-debian 78s libarchive-zip-perl libasan8 libcc1-0 libdebhelper-perl 78s libfile-stripnondeterminism-perl libgcc-15-dev libgomp1 libhwasan0 libisl23 78s libitm1 liblsan0 libmpc3 libpython3.14-minimal libpython3.14-stdlib 78s libstdc++-15-dev libtool libtsan2 libubsan1 m4 po-debconf 78s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python3-all 78s python3-astroid python3-build python3-iniconfig python3-installer 78s python3-lazy-object-proxy python3-pip python3-pluggy python3-pyproject-hooks 78s python3-pytest python3-pytest-runner python3-wheel python3-wrapt python3.14 78s python3.14-minimal 78s 0 upgraded, 62 newly installed, 0 to remove and 0 not upgraded. 78s Need to get 77.8 MB of archives. 78s After this operation, 278 MB of additional disk space will be used. 78s Get:1 http://ftpmaster.internal/ubuntu resolute/main arm64 libpython3.14-minimal arm64 3.14.0-4 [903 kB] 78s Get:2 http://ftpmaster.internal/ubuntu resolute/main arm64 python3.14-minimal arm64 3.14.0-4 [2543 kB] 79s Get:3 http://ftpmaster.internal/ubuntu resolute/main arm64 m4 arm64 1.4.20-2 [213 kB] 79s Get:4 http://ftpmaster.internal/ubuntu resolute/main arm64 autoconf all 2.72-3.1ubuntu1 [384 kB] 79s Get:5 http://ftpmaster.internal/ubuntu resolute/main arm64 autotools-dev all 20240727.1 [43.4 kB] 79s Get:6 http://ftpmaster.internal/ubuntu resolute/main arm64 automake all 1:1.18.1-2 [581 kB] 79s Get:7 http://ftpmaster.internal/ubuntu resolute/main arm64 autopoint all 0.23.2-1 [620 kB] 79s Get:8 http://ftpmaster.internal/ubuntu resolute/main arm64 libisl23 arm64 0.27-1 [676 kB] 79s Get:9 http://ftpmaster.internal/ubuntu resolute/main arm64 libmpc3 arm64 1.3.1-2 [55.6 kB] 79s Get:10 http://ftpmaster.internal/ubuntu resolute/main arm64 cpp-15-aarch64-linux-gnu arm64 15.2.0-7ubuntu1 [11.7 MB] 79s Get:11 http://ftpmaster.internal/ubuntu resolute/main arm64 cpp-15 arm64 15.2.0-7ubuntu1 [1026 B] 79s Get:12 http://ftpmaster.internal/ubuntu resolute/main arm64 cpp-aarch64-linux-gnu arm64 4:15.2.0-4ubuntu1 [5736 B] 79s Get:13 http://ftpmaster.internal/ubuntu resolute/main arm64 cpp arm64 4:15.2.0-4ubuntu1 [22.4 kB] 79s Get:14 http://ftpmaster.internal/ubuntu resolute/main arm64 libcc1-0 arm64 15.2.0-7ubuntu1 [49.0 kB] 79s Get:15 http://ftpmaster.internal/ubuntu resolute/main arm64 libgomp1 arm64 15.2.0-7ubuntu1 [147 kB] 79s Get:16 http://ftpmaster.internal/ubuntu resolute/main arm64 libitm1 arm64 15.2.0-7ubuntu1 [27.9 kB] 79s Get:17 http://ftpmaster.internal/ubuntu resolute/main arm64 libasan8 arm64 15.2.0-7ubuntu1 [2923 kB] 79s Get:18 http://ftpmaster.internal/ubuntu resolute/main arm64 liblsan0 arm64 15.2.0-7ubuntu1 [1316 kB] 79s Get:19 http://ftpmaster.internal/ubuntu resolute/main arm64 libtsan2 arm64 15.2.0-7ubuntu1 [2689 kB] 79s Get:20 http://ftpmaster.internal/ubuntu resolute/main arm64 libubsan1 arm64 15.2.0-7ubuntu1 [1176 kB] 79s Get:21 http://ftpmaster.internal/ubuntu resolute/main arm64 libhwasan0 arm64 15.2.0-7ubuntu1 [1638 kB] 79s Get:22 http://ftpmaster.internal/ubuntu resolute/main arm64 libgcc-15-dev arm64 15.2.0-7ubuntu1 [2600 kB] 80s Get:23 http://ftpmaster.internal/ubuntu resolute/main arm64 gcc-15-aarch64-linux-gnu arm64 15.2.0-7ubuntu1 [23.1 MB] 80s Get:24 http://ftpmaster.internal/ubuntu resolute/main arm64 gcc-15 arm64 15.2.0-7ubuntu1 [513 kB] 80s Get:25 http://ftpmaster.internal/ubuntu resolute/main arm64 gcc-aarch64-linux-gnu arm64 4:15.2.0-4ubuntu1 [1206 B] 80s Get:26 http://ftpmaster.internal/ubuntu resolute/main arm64 gcc arm64 4:15.2.0-4ubuntu1 [5016 B] 80s Get:27 http://ftpmaster.internal/ubuntu resolute/main arm64 libstdc++-15-dev arm64 15.2.0-7ubuntu1 [2546 kB] 80s Get:28 http://ftpmaster.internal/ubuntu resolute/main arm64 g++-15-aarch64-linux-gnu arm64 15.2.0-7ubuntu1 [13.2 MB] 81s Get:29 http://ftpmaster.internal/ubuntu resolute/main arm64 g++-15 arm64 15.2.0-7ubuntu1 [23.7 kB] 81s Get:30 http://ftpmaster.internal/ubuntu resolute/main arm64 g++-aarch64-linux-gnu arm64 4:15.2.0-4ubuntu1 [956 B] 81s Get:31 http://ftpmaster.internal/ubuntu resolute/main arm64 g++ arm64 4:15.2.0-4ubuntu1 [1080 B] 81s Get:32 http://ftpmaster.internal/ubuntu resolute/main arm64 build-essential arm64 12.12ubuntu1 [5082 B] 81s Get:33 http://ftpmaster.internal/ubuntu resolute/main arm64 libdebhelper-perl all 13.24.2ubuntu1 [95.7 kB] 81s Get:34 http://ftpmaster.internal/ubuntu resolute/main arm64 libtool all 2.5.4-7 [169 kB] 81s Get:35 http://ftpmaster.internal/ubuntu resolute/main arm64 dh-autoreconf all 21 [12.5 kB] 81s Get:36 http://ftpmaster.internal/ubuntu resolute/main arm64 libarchive-zip-perl all 1.68-1 [90.2 kB] 81s Get:37 http://ftpmaster.internal/ubuntu resolute/main arm64 libfile-stripnondeterminism-perl all 1.15.0-1 [20.5 kB] 81s Get:38 http://ftpmaster.internal/ubuntu resolute/main arm64 dh-strip-nondeterminism all 1.15.0-1 [5090 B] 81s Get:39 http://ftpmaster.internal/ubuntu resolute/main arm64 debugedit arm64 1:5.2-3 [49.1 kB] 81s Get:40 http://ftpmaster.internal/ubuntu resolute/main arm64 dwz arm64 0.16-2 [113 kB] 81s Get:41 http://ftpmaster.internal/ubuntu resolute/main arm64 gettext arm64 0.23.2-1 [998 kB] 81s Get:42 http://ftpmaster.internal/ubuntu resolute/main arm64 intltool-debian all 0.35.0+20060710.6 [23.2 kB] 81s Get:43 http://ftpmaster.internal/ubuntu resolute/main arm64 po-debconf all 1.0.21+nmu1 [233 kB] 81s Get:44 http://ftpmaster.internal/ubuntu resolute/main arm64 debhelper all 13.24.2ubuntu1 [896 kB] 81s Get:45 http://ftpmaster.internal/ubuntu resolute/universe arm64 dh-python all 6.20250414 [119 kB] 81s Get:46 http://ftpmaster.internal/ubuntu resolute/main arm64 libpython3.14-stdlib arm64 3.14.0-4 [2349 kB] 81s Get:47 http://ftpmaster.internal/ubuntu resolute/universe arm64 pybuild-plugin-autopkgtest all 6.20250414 [1746 B] 81s Get:48 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-pyproject-hooks all 1.2.0-1 [10.2 kB] 81s Get:49 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-wheel all 0.46.1-2 [22.1 kB] 81s Get:50 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-build all 1.2.2-4 [31.0 kB] 81s Get:51 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-installer all 0.7.0+dfsg1-3 [17.4 kB] 81s Get:52 http://ftpmaster.internal/ubuntu resolute/universe arm64 pybuild-plugin-pyproject all 6.20250414 [1728 B] 81s Get:53 http://ftpmaster.internal/ubuntu resolute/main arm64 python3.14 arm64 3.14.0-4 [805 kB] 81s Get:54 http://ftpmaster.internal/ubuntu resolute-proposed/main arm64 python3-all arm64 3.13.7-2 [890 B] 81s Get:55 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-astroid all 3.3.8-2 [175 kB] 81s Get:56 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-iniconfig all 2.1.0-1 [6840 B] 81s Get:57 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-lazy-object-proxy arm64 1.12.0-1 [26.3 kB] 81s Get:58 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-pip all 25.1.1+dfsg-1ubuntu2 [1416 kB] 81s Get:59 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-pluggy all 1.6.0-1 [21.0 kB] 81s Get:60 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-pytest all 8.3.5-2 [252 kB] 81s Get:61 http://ftpmaster.internal/ubuntu resolute/universe arm64 python3-pytest-runner all 2.11.1-5 [7592 B] 81s Get:62 http://ftpmaster.internal/ubuntu resolute/main arm64 python3-wrapt arm64 1.17.3-2 [39.9 kB] 82s Fetched 77.8 MB in 4s (21.8 MB/s) 82s Selecting previously unselected package libpython3.14-minimal:arm64. 82s (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 ... 88137 files and directories currently installed.) 82s Preparing to unpack .../00-libpython3.14-minimal_3.14.0-4_arm64.deb ... 82s Unpacking libpython3.14-minimal:arm64 (3.14.0-4) ... 82s Selecting previously unselected package python3.14-minimal. 82s Preparing to unpack .../01-python3.14-minimal_3.14.0-4_arm64.deb ... 82s Unpacking python3.14-minimal (3.14.0-4) ... 83s Selecting previously unselected package m4. 83s Preparing to unpack .../02-m4_1.4.20-2_arm64.deb ... 83s Unpacking m4 (1.4.20-2) ... 83s Selecting previously unselected package autoconf. 83s Preparing to unpack .../03-autoconf_2.72-3.1ubuntu1_all.deb ... 83s Unpacking autoconf (2.72-3.1ubuntu1) ... 83s Selecting previously unselected package autotools-dev. 83s Preparing to unpack .../04-autotools-dev_20240727.1_all.deb ... 83s Unpacking autotools-dev (20240727.1) ... 83s Selecting previously unselected package automake. 83s Preparing to unpack .../05-automake_1%3a1.18.1-2_all.deb ... 83s Unpacking automake (1:1.18.1-2) ... 83s Selecting previously unselected package autopoint. 83s Preparing to unpack .../06-autopoint_0.23.2-1_all.deb ... 83s Unpacking autopoint (0.23.2-1) ... 83s Selecting previously unselected package libisl23:arm64. 83s Preparing to unpack .../07-libisl23_0.27-1_arm64.deb ... 83s Unpacking libisl23:arm64 (0.27-1) ... 83s Selecting previously unselected package libmpc3:arm64. 83s Preparing to unpack .../08-libmpc3_1.3.1-2_arm64.deb ... 83s Unpacking libmpc3:arm64 (1.3.1-2) ... 83s Selecting previously unselected package cpp-15-aarch64-linux-gnu. 83s Preparing to unpack .../09-cpp-15-aarch64-linux-gnu_15.2.0-7ubuntu1_arm64.deb ... 83s Unpacking cpp-15-aarch64-linux-gnu (15.2.0-7ubuntu1) ... 83s Selecting previously unselected package cpp-15. 83s Preparing to unpack .../10-cpp-15_15.2.0-7ubuntu1_arm64.deb ... 83s Unpacking cpp-15 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package cpp-aarch64-linux-gnu. 84s Preparing to unpack .../11-cpp-aarch64-linux-gnu_4%3a15.2.0-4ubuntu1_arm64.deb ... 84s Unpacking cpp-aarch64-linux-gnu (4:15.2.0-4ubuntu1) ... 84s Selecting previously unselected package cpp. 84s Preparing to unpack .../12-cpp_4%3a15.2.0-4ubuntu1_arm64.deb ... 84s Unpacking cpp (4:15.2.0-4ubuntu1) ... 84s Selecting previously unselected package libcc1-0:arm64. 84s Preparing to unpack .../13-libcc1-0_15.2.0-7ubuntu1_arm64.deb ... 84s Unpacking libcc1-0:arm64 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package libgomp1:arm64. 84s Preparing to unpack .../14-libgomp1_15.2.0-7ubuntu1_arm64.deb ... 84s Unpacking libgomp1:arm64 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package libitm1:arm64. 84s Preparing to unpack .../15-libitm1_15.2.0-7ubuntu1_arm64.deb ... 84s Unpacking libitm1:arm64 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package libasan8:arm64. 84s Preparing to unpack .../16-libasan8_15.2.0-7ubuntu1_arm64.deb ... 84s Unpacking libasan8:arm64 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package liblsan0:arm64. 84s Preparing to unpack .../17-liblsan0_15.2.0-7ubuntu1_arm64.deb ... 84s Unpacking liblsan0:arm64 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package libtsan2:arm64. 84s Preparing to unpack .../18-libtsan2_15.2.0-7ubuntu1_arm64.deb ... 84s Unpacking libtsan2:arm64 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package libubsan1:arm64. 84s Preparing to unpack .../19-libubsan1_15.2.0-7ubuntu1_arm64.deb ... 84s Unpacking libubsan1:arm64 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package libhwasan0:arm64. 84s Preparing to unpack .../20-libhwasan0_15.2.0-7ubuntu1_arm64.deb ... 84s Unpacking libhwasan0:arm64 (15.2.0-7ubuntu1) ... 84s Selecting previously unselected package libgcc-15-dev:arm64. 84s Preparing to unpack .../21-libgcc-15-dev_15.2.0-7ubuntu1_arm64.deb ... 85s Unpacking libgcc-15-dev:arm64 (15.2.0-7ubuntu1) ... 85s Selecting previously unselected package gcc-15-aarch64-linux-gnu. 85s Preparing to unpack .../22-gcc-15-aarch64-linux-gnu_15.2.0-7ubuntu1_arm64.deb ... 85s Unpacking gcc-15-aarch64-linux-gnu (15.2.0-7ubuntu1) ... 85s Selecting previously unselected package gcc-15. 85s Preparing to unpack .../23-gcc-15_15.2.0-7ubuntu1_arm64.deb ... 85s Unpacking gcc-15 (15.2.0-7ubuntu1) ... 85s Selecting previously unselected package gcc-aarch64-linux-gnu. 85s Preparing to unpack .../24-gcc-aarch64-linux-gnu_4%3a15.2.0-4ubuntu1_arm64.deb ... 85s Unpacking gcc-aarch64-linux-gnu (4:15.2.0-4ubuntu1) ... 85s Selecting previously unselected package gcc. 85s Preparing to unpack .../25-gcc_4%3a15.2.0-4ubuntu1_arm64.deb ... 85s Unpacking gcc (4:15.2.0-4ubuntu1) ... 86s Selecting previously unselected package libstdc++-15-dev:arm64. 86s Preparing to unpack .../26-libstdc++-15-dev_15.2.0-7ubuntu1_arm64.deb ... 86s Unpacking libstdc++-15-dev:arm64 (15.2.0-7ubuntu1) ... 86s Selecting previously unselected package g++-15-aarch64-linux-gnu. 86s Preparing to unpack .../27-g++-15-aarch64-linux-gnu_15.2.0-7ubuntu1_arm64.deb ... 86s Unpacking g++-15-aarch64-linux-gnu (15.2.0-7ubuntu1) ... 86s Selecting previously unselected package g++-15. 86s Preparing to unpack .../28-g++-15_15.2.0-7ubuntu1_arm64.deb ... 86s Unpacking g++-15 (15.2.0-7ubuntu1) ... 86s Selecting previously unselected package g++-aarch64-linux-gnu. 86s Preparing to unpack .../29-g++-aarch64-linux-gnu_4%3a15.2.0-4ubuntu1_arm64.deb ... 86s Unpacking g++-aarch64-linux-gnu (4:15.2.0-4ubuntu1) ... 86s Selecting previously unselected package g++. 86s Preparing to unpack .../30-g++_4%3a15.2.0-4ubuntu1_arm64.deb ... 86s Unpacking g++ (4:15.2.0-4ubuntu1) ... 86s Selecting previously unselected package build-essential. 86s Preparing to unpack .../31-build-essential_12.12ubuntu1_arm64.deb ... 86s Unpacking build-essential (12.12ubuntu1) ... 86s Selecting previously unselected package libdebhelper-perl. 86s Preparing to unpack .../32-libdebhelper-perl_13.24.2ubuntu1_all.deb ... 87s Unpacking libdebhelper-perl (13.24.2ubuntu1) ... 87s Selecting previously unselected package libtool. 87s Preparing to unpack .../33-libtool_2.5.4-7_all.deb ... 87s Unpacking libtool (2.5.4-7) ... 87s Selecting previously unselected package dh-autoreconf. 87s Preparing to unpack .../34-dh-autoreconf_21_all.deb ... 87s Unpacking dh-autoreconf (21) ... 87s Selecting previously unselected package libarchive-zip-perl. 87s Preparing to unpack .../35-libarchive-zip-perl_1.68-1_all.deb ... 87s Unpacking libarchive-zip-perl (1.68-1) ... 87s Selecting previously unselected package libfile-stripnondeterminism-perl. 87s Preparing to unpack .../36-libfile-stripnondeterminism-perl_1.15.0-1_all.deb ... 87s Unpacking libfile-stripnondeterminism-perl (1.15.0-1) ... 87s Selecting previously unselected package dh-strip-nondeterminism. 87s Preparing to unpack .../37-dh-strip-nondeterminism_1.15.0-1_all.deb ... 87s Unpacking dh-strip-nondeterminism (1.15.0-1) ... 87s Selecting previously unselected package debugedit. 87s Preparing to unpack .../38-debugedit_1%3a5.2-3_arm64.deb ... 87s Unpacking debugedit (1:5.2-3) ... 87s Selecting previously unselected package dwz. 87s Preparing to unpack .../39-dwz_0.16-2_arm64.deb ... 87s Unpacking dwz (0.16-2) ... 87s Selecting previously unselected package gettext. 87s Preparing to unpack .../40-gettext_0.23.2-1_arm64.deb ... 87s Unpacking gettext (0.23.2-1) ... 87s Selecting previously unselected package intltool-debian. 87s Preparing to unpack .../41-intltool-debian_0.35.0+20060710.6_all.deb ... 87s Unpacking intltool-debian (0.35.0+20060710.6) ... 87s Selecting previously unselected package po-debconf. 87s Preparing to unpack .../42-po-debconf_1.0.21+nmu1_all.deb ... 87s Unpacking po-debconf (1.0.21+nmu1) ... 87s Selecting previously unselected package debhelper. 87s Preparing to unpack .../43-debhelper_13.24.2ubuntu1_all.deb ... 87s Unpacking debhelper (13.24.2ubuntu1) ... 87s Selecting previously unselected package dh-python. 87s Preparing to unpack .../44-dh-python_6.20250414_all.deb ... 87s Unpacking dh-python (6.20250414) ... 87s Selecting previously unselected package libpython3.14-stdlib:arm64. 87s Preparing to unpack .../45-libpython3.14-stdlib_3.14.0-4_arm64.deb ... 87s Unpacking libpython3.14-stdlib:arm64 (3.14.0-4) ... 87s Selecting previously unselected package pybuild-plugin-autopkgtest. 87s Preparing to unpack .../46-pybuild-plugin-autopkgtest_6.20250414_all.deb ... 87s Unpacking pybuild-plugin-autopkgtest (6.20250414) ... 87s Selecting previously unselected package python3-pyproject-hooks. 88s Preparing to unpack .../47-python3-pyproject-hooks_1.2.0-1_all.deb ... 88s Unpacking python3-pyproject-hooks (1.2.0-1) ... 88s Selecting previously unselected package python3-wheel. 88s Preparing to unpack .../48-python3-wheel_0.46.1-2_all.deb ... 88s Unpacking python3-wheel (0.46.1-2) ... 88s Selecting previously unselected package python3-build. 88s Preparing to unpack .../49-python3-build_1.2.2-4_all.deb ... 88s Unpacking python3-build (1.2.2-4) ... 88s Selecting previously unselected package python3-installer. 88s Preparing to unpack .../50-python3-installer_0.7.0+dfsg1-3_all.deb ... 88s Unpacking python3-installer (0.7.0+dfsg1-3) ... 88s Selecting previously unselected package pybuild-plugin-pyproject. 88s Preparing to unpack .../51-pybuild-plugin-pyproject_6.20250414_all.deb ... 88s Unpacking pybuild-plugin-pyproject (6.20250414) ... 88s Selecting previously unselected package python3.14. 88s Preparing to unpack .../52-python3.14_3.14.0-4_arm64.deb ... 88s Unpacking python3.14 (3.14.0-4) ... 88s Selecting previously unselected package python3-all. 88s Preparing to unpack .../53-python3-all_3.13.7-2_arm64.deb ... 88s Unpacking python3-all (3.13.7-2) ... 88s Selecting previously unselected package python3-astroid. 88s Preparing to unpack .../54-python3-astroid_3.3.8-2_all.deb ... 88s Unpacking python3-astroid (3.3.8-2) ... 88s Selecting previously unselected package python3-iniconfig. 88s Preparing to unpack .../55-python3-iniconfig_2.1.0-1_all.deb ... 88s Unpacking python3-iniconfig (2.1.0-1) ... 88s Selecting previously unselected package python3-lazy-object-proxy. 88s Preparing to unpack .../56-python3-lazy-object-proxy_1.12.0-1_arm64.deb ... 88s Unpacking python3-lazy-object-proxy (1.12.0-1) ... 88s Selecting previously unselected package python3-pip. 88s Preparing to unpack .../57-python3-pip_25.1.1+dfsg-1ubuntu2_all.deb ... 88s Unpacking python3-pip (25.1.1+dfsg-1ubuntu2) ... 88s Selecting previously unselected package python3-pluggy. 88s Preparing to unpack .../58-python3-pluggy_1.6.0-1_all.deb ... 88s Unpacking python3-pluggy (1.6.0-1) ... 88s Selecting previously unselected package python3-pytest. 88s Preparing to unpack .../59-python3-pytest_8.3.5-2_all.deb ... 88s Unpacking python3-pytest (8.3.5-2) ... 88s Selecting previously unselected package python3-pytest-runner. 88s Preparing to unpack .../60-python3-pytest-runner_2.11.1-5_all.deb ... 88s Unpacking python3-pytest-runner (2.11.1-5) ... 88s Selecting previously unselected package python3-wrapt. 88s Preparing to unpack .../61-python3-wrapt_1.17.3-2_arm64.deb ... 88s Unpacking python3-wrapt (1.17.3-2) ... 88s Setting up dh-python (6.20250414) ... 89s Setting up python3-iniconfig (2.1.0-1) ... 89s Setting up libarchive-zip-perl (1.68-1) ... 89s Setting up libdebhelper-perl (13.24.2ubuntu1) ... 89s Setting up libpython3.14-minimal:arm64 (3.14.0-4) ... 89s Setting up m4 (1.4.20-2) ... 89s Setting up libgomp1:arm64 (15.2.0-7ubuntu1) ... 89s Setting up python3-wheel (0.46.1-2) ... 90s Setting up autotools-dev (20240727.1) ... 90s Setting up python3-pyproject-hooks (1.2.0-1) ... 90s Setting up libmpc3:arm64 (1.3.1-2) ... 90s Setting up python3-wrapt (1.17.3-2) ... 90s Setting up autopoint (0.23.2-1) ... 90s Setting up python3-pip (25.1.1+dfsg-1ubuntu2) ... 94s Setting up python3-installer (0.7.0+dfsg1-3) ... 94s Setting up autoconf (2.72-3.1ubuntu1) ... 94s Setting up python3-pluggy (1.6.0-1) ... 95s Setting up libubsan1:arm64 (15.2.0-7ubuntu1) ... 95s Setting up dwz (0.16-2) ... 95s Setting up python3-astroid (3.3.8-2) ... 96s Setting up libhwasan0:arm64 (15.2.0-7ubuntu1) ... 96s Setting up libasan8:arm64 (15.2.0-7ubuntu1) ... 96s Setting up debugedit (1:5.2-3) ... 96s Setting up python3-pytest-runner (2.11.1-5) ... 96s Setting up libtsan2:arm64 (15.2.0-7ubuntu1) ... 96s Setting up python3-lazy-object-proxy (1.12.0-1) ... 97s Setting up libisl23:arm64 (0.27-1) ... 97s Setting up python3-build (1.2.2-4) ... 97s Setting up python3.14-minimal (3.14.0-4) ... 98s Setting up libcc1-0:arm64 (15.2.0-7ubuntu1) ... 98s Setting up liblsan0:arm64 (15.2.0-7ubuntu1) ... 98s Setting up libitm1:arm64 (15.2.0-7ubuntu1) ... 98s Setting up automake (1:1.18.1-2) ... 98s update-alternatives: using /usr/bin/automake-1.18 to provide /usr/bin/automake (automake) in auto mode 98s Setting up libfile-stripnondeterminism-perl (1.15.0-1) ... 98s Setting up cpp-15-aarch64-linux-gnu (15.2.0-7ubuntu1) ... 98s Setting up gettext (0.23.2-1) ... 98s Setting up libgcc-15-dev:arm64 (15.2.0-7ubuntu1) ... 98s Setting up libpython3.14-stdlib:arm64 (3.14.0-4) ... 98s Setting up pybuild-plugin-pyproject (6.20250414) ... 98s Setting up python3-pytest (8.3.5-2) ... 100s Setting up intltool-debian (0.35.0+20060710.6) ... 100s Setting up cpp-aarch64-linux-gnu (4:15.2.0-4ubuntu1) ... 100s Setting up libstdc++-15-dev:arm64 (15.2.0-7ubuntu1) ... 100s Setting up dh-strip-nondeterminism (1.15.0-1) ... 100s Setting up cpp-15 (15.2.0-7ubuntu1) ... 100s Setting up cpp (4:15.2.0-4ubuntu1) ... 100s Setting up python3.14 (3.14.0-4) ... 101s Setting up gcc-15-aarch64-linux-gnu (15.2.0-7ubuntu1) ... 101s Setting up po-debconf (1.0.21+nmu1) ... 101s Setting up python3-all (3.13.7-2) ... 101s Setting up gcc-15 (15.2.0-7ubuntu1) ... 101s Setting up g++-15-aarch64-linux-gnu (15.2.0-7ubuntu1) ... 101s Setting up g++-15 (15.2.0-7ubuntu1) ... 101s Setting up gcc-aarch64-linux-gnu (4:15.2.0-4ubuntu1) ... 101s Setting up libtool (2.5.4-7) ... 101s Setting up gcc (4:15.2.0-4ubuntu1) ... 101s Setting up dh-autoreconf (21) ... 101s Setting up g++-aarch64-linux-gnu (4:15.2.0-4ubuntu1) ... 101s Setting up debhelper (13.24.2ubuntu1) ... 101s Setting up g++ (4:15.2.0-4ubuntu1) ... 101s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 101s Setting up build-essential (12.12ubuntu1) ... 101s Setting up pybuild-plugin-autopkgtest (6.20250414) ... 101s Processing triggers for man-db (2.13.1-1) ... 102s Processing triggers for install-info (7.2-5) ... 102s Processing triggers for libc-bin (2.42-2ubuntu2) ... 102s Processing triggers for systemd (257.9-0ubuntu2) ... 104s autopkgtest [13:33:02]: test pybuild-autopkgtest: pybuild-autopkgtest 104s autopkgtest [13:33:02]: test pybuild-autopkgtest: [----------------------- 104s pybuild-autopkgtest 104s I: pybuild base:311: cd /tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build; python3.14 -m pytest tests 108s ============================= test session starts ============================== 108s platform linux -- Python 3.14.0, pytest-8.3.5, pluggy-1.6.0 108s rootdir: /tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build 108s configfile: pyproject.toml 108s plugins: typeguard-4.4.2 108s collected 1708 items 108s 108s tests/brain/numpy/test_core_einsumfunc.py ss [ 0%] 108s tests/brain/numpy/test_core_fromnumeric.py s [ 0%] 108s tests/brain/numpy/test_core_function_base.py s [ 0%] 108s tests/brain/numpy/test_core_multiarray.py sssss [ 0%] 108s tests/brain/numpy/test_core_numeric.py sssss [ 0%] 108s tests/brain/numpy/test_core_numerictypes.py sssssss.. [ 1%] 108s tests/brain/numpy/test_core_umath.py ssssssss [ 1%] 108s tests/brain/numpy/test_ma.py ssss [ 2%] 108s tests/brain/numpy/test_ndarray.py sss [ 2%] 108s tests/brain/numpy/test_random_mtrand.py ss [ 2%] 108s tests/brain/test_argparse.py . [ 2%] 108s tests/brain/test_attr.py ....... [ 2%] 109s tests/brain/test_brain.py ......s.....ss......F......................... [ 5%] 110s ..........F.s.........................................................x. [ 9%] 110s ..............s...... [ 10%] 110s tests/brain/test_builtin.py .................. [ 12%] 110s tests/brain/test_ctypes.py ....x........................ [ 13%] 110s tests/brain/test_dataclasses.py ........................................ [ 16%] 111s ......................................x... [ 18%] 111s tests/brain/test_dateutil.py . [ 18%] 111s tests/brain/test_enum.py ............................. [ 20%] 111s tests/brain/test_hashlib.py ... [ 20%] 111s tests/brain/test_multiprocessing.py ... [ 20%] 111s tests/brain/test_named_tuple.py ....................... [ 21%] 111s tests/brain/test_nose.py s [ 22%] 111s tests/brain/test_pathlib.py FF.. [ 22%] 111s tests/brain/test_pytest.py . [ 22%] 111s tests/brain/test_qt.py sss [ 22%] 111s tests/brain/test_regex.py ss [ 22%] 111s tests/brain/test_signal.py ... [ 22%] 113s tests/brain/test_six.py ....... [ 23%] 113s tests/brain/test_ssl.py .. [ 23%] 113s tests/brain/test_threading.py .... [ 23%] 113s tests/brain/test_typing.py ..... [ 23%] 114s tests/brain/test_typing_extensions.py . [ 23%] 114s tests/brain/test_unittest.py . [ 23%] 116s tests/test_builder.py ...........................................FFFFFFF [ 26%] 116s FFFF.... [ 27%] 116s tests/test_constraint.py ................................... [ 29%] 116s tests/test_decorators.py ... [ 29%] 116s tests/test_filter_statements.py . [ 29%] 116s tests/test_group_exceptions.py ... [ 29%] 116s tests/test_helpers.py ............... [ 30%] 116s tests/test_inference.py ............................................F... [ 33%] 117s ............................................x...........x......x........ [ 37%] 118s ..................................................x..................... [ 41%] 119s ........................................................................ [ 46%] 120s ................................................x........xx............. [ 50%] 121s ........x...x................................................x.......... [ 54%] 121s ................................. [ 56%] 121s tests/test_inference_calls.py ........................ [ 57%] 125s tests/test_lookup.py FFFFFFFFFFFFFFFFFFFFFFFFFFFF....................... [ 60%] 125s .... [ 61%] 154s tests/test_manager.py .....................................s....... [ 63%] 155s tests/test_modutils.py ................................................. [ 66%] 155s ................s. [ 67%] 157s tests/test_nodes.py ............F................FFFFFFFFF.............. [ 70%] 157s ........................................................................ [ 74%] 157s ................................................................ [ 78%] 157s tests/test_nodes_lineno.py ....................... [ 80%] 157s tests/test_nodes_position.py ... [ 80%] 160s tests/test_object_model.py x...............x.........s........... [ 82%] 160s tests/test_objects.py ...................... [ 83%] 160s tests/test_protocols.py ..................... [ 84%] 160s tests/test_python3.py .......................... [ 86%] 160s tests/test_raw_building.py ............. [ 87%] 167s tests/test_regrtest.py .............ss............ [ 88%] 171s tests/test_scoped_nodes.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 91%] 176s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 95%] 178s FFFFFFFFFFFFFFFF.................................. [ 98%] 178s tests/test_stdlib.py .. [ 98%] 178s tests/test_transforms.py ......... [ 99%] 178s tests/test_type_params.py ..... [ 99%] 178s tests/test_utils.py ........ [100%] 178s 178s =================================== FAILURES =================================== 178s _______________________ TypingBrain.test_has_dunder_args _______________________ 178s 178s self = 178s 178s def test_has_dunder_args(self) -> None: 178s ast_node = builder.extract_node( 178s """ 178s from typing import Union 178s NumericTypes = Union[int, float] 178s NumericTypes.__args__ #@ 178s """ 178s ) 178s inferred = next(ast_node.infer()) 178s > assert isinstance(inferred, nodes.Tuple) 178s E AssertionError: assert False 178s E + where False = isinstance(Uninferable, ) 178s E + where = nodes.Tuple 178s 178s tests/brain/test_brain.py:747: AssertionError 178s ________________________ TypingBrain.test_typing_types _________________________ 178s 178s self = 178s 178s def test_typing_types(self) -> None: 178s ast_nodes = builder.extract_node( 178s """ 178s from typing import TypeVar, Iterable, Tuple, NewType, Dict, Union 178s TypeVar('MyTypeVar', int, float, complex) #@ 178s Iterable[Tuple[MyTypeVar, MyTypeVar]] #@ 178s TypeVar('AnyStr', str, bytes) #@ 178s NewType('UserId', str) #@ 178s Dict[str, str] #@ 178s Union[int, str] #@ 178s """ 178s ) 178s for node in ast_nodes: 178s inferred = next(node.infer()) 178s > self.assertIsInstance(inferred, nodes.ClassDef, node.as_string()) 178s E AssertionError: Uninferable is not an instance of : Union[int, str] 178s 178s tests/brain/test_brain.py:561: AssertionError 178s ____________________________ test_inference_parents ____________________________ 178s 178s def test_inference_parents() -> None: 178s """Test inference of ``pathlib.Path.parents``.""" 178s name_node = astroid.extract_node( 178s """ 178s from pathlib import Path 178s 178s current_path = Path().resolve() 178s path_parents = current_path.parents 178s path_parents 178s """ 178s ) 178s inferred = name_node.inferred() 178s assert len(inferred) == 1 178s assert isinstance(inferred[0], bases.Instance) 178s if PY313_PLUS: 178s > assert inferred[0].qname() == "builtins.tuple" 178s E AssertionError: assert 'pathlib._PathParents' == 'builtins.tuple' 178s E 178s E - builtins.tuple 178s E + pathlib._PathParents 178s 178s tests/brain/test_pathlib.py:27: AssertionError 178s ____________________ test_inference_parents_subscript_index ____________________ 178s 178s def test_inference_parents_subscript_index() -> None: 178s """Test inference of ``pathlib.Path.parents``, accessed by index.""" 178s path = astroid.extract_node( 178s """ 178s from pathlib import Path 178s 178s current_path = Path().resolve() 178s current_path.parents[2] #@ 178s """ 178s ) 178s 178s inferred = path.inferred() 178s assert len(inferred) == 1 178s assert isinstance(inferred[0], bases.Instance) 178s if PY313_PLUS: 178s > assert inferred[0].qname() == "pathlib._local.Path" 178s E AssertionError: assert 'builtins.tuple' == 'pathlib._local.Path' 178s E 178s E - pathlib._local.Path 178s E + builtins.tuple 178s 178s tests/brain/test_pathlib.py:47: AssertionError 178s _____________________ FileBuildTest.test_class_base_props ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ______________________ FileBuildTest.test_class_basenames ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________________ FileBuildTest.test_class_instance_attrs ____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ FileBuildTest.test_class_locals ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________ FileBuildTest.test_function_base_props ____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ______________________ FileBuildTest.test_function_locals ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ FileBuildTest.test_method_base_props _____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ FileBuildTest.test_method_locals _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ FileBuildTest.test_module_base_props _____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ FileBuildTest.test_module_locals _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ FileBuildTest.test_unknown_encoding ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_builder.py:752: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s __________________ InferenceTest.test_binary_op_or_union_type __________________ 178s 178s self = 178s 178s def test_binary_op_or_union_type(self) -> None: 178s """Binary or union is only defined for Python 3.10+.""" 178s code = """ 178s class A: ... 178s 178s int | 2 #@ 178s int | "Hello" #@ 178s int | ... #@ 178s int | A() #@ 178s int | None | 2 #@ 178s """ 178s ast_nodes = extract_node(code) 178s for n in ast_nodes: 178s assert n.inferred() == [util.Uninferable] 178s 178s code = """ 178s from typing import List 178s 178s class A: ... 178s class B: ... 178s 178s int | None #@ 178s int | str #@ 178s int | str | None #@ 178s A | B #@ 178s A | None #@ 178s List[int] | int #@ 178s tuple | int #@ 178s """ 178s ast_nodes = extract_node(code) 178s if not PY310_PLUS: 178s for n in ast_nodes: 178s assert n.inferred() == [util.Uninferable] 178s else: 178s i0 = ast_nodes[0].inferred()[0] 178s assert isinstance(i0, UnionType) 178s assert isinstance(i0.left, nodes.ClassDef) 178s assert i0.left.name == "int" 178s assert isinstance(i0.right, nodes.Const) 178s assert i0.right.value is None 178s 178s # Assert basic UnionType properties and methods 178s assert i0.callable() is False 178s assert i0.bool_value() is True 178s assert i0.pytype() == "types.UnionType" 178s assert i0.display_type() == "UnionType" 178s > assert str(i0) == "UnionType(UnionType)" 178s E AssertionError: assert 'UnionType(Union)' == 'UnionType(UnionType)' 178s E 178s E - UnionType(UnionType) 178s E ? ---- 178s E + UnionType(Union) 178s 178s tests/test_inference.py:1309: AssertionError 178s ________________________ LookupTest.test_builtin_lookup ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________________ LookupTest.test_class _____________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ LookupTest.test_class_ancestor_name ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ______________________ LookupTest.test_class_in_function _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ LookupTest.test_class_variables ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s __________________ LookupTest.test_decorator_arguments_lookup __________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ LookupTest.test_dict_comp_nested _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s __________________________ LookupTest.test_dict_comps __________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ______________________ LookupTest.test_explicit___name__ _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________ LookupTest.test_function_argument_with_default ________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________________ LookupTest.test_function_module_special ____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ LookupTest.test_function_nested ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ LookupTest.test_generator_attributes _____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________________ LookupTest.test_global_delete _________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________________ LookupTest.test_inner_classes _________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________ LookupTest.test_inner_decorator_member_lookup _________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________________ LookupTest.test_lambda_nested _________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________________ LookupTest.test_limit _____________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ LookupTest.test_list_comp_nested _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ LookupTest.test_list_comp_target _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s __________________________ LookupTest.test_list_comps __________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________________ LookupTest.test_loopvar_hiding ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________________ LookupTest.test_method ____________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________________ LookupTest.test_module ____________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ LookupTest.test_set_comp_closure _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ LookupTest.test_set_comp_nested ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s __________________________ LookupTest.test_set_comps ___________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ LookupTest.test_static_method_lookup _____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_lookup.py:22: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ______________________ AsStringTest.test_module_as_string ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def test_module_as_string(self) -> None: 178s """Check as_string on a whole module prepared to be returned identically.""" 178s > module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:114: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ ImportNodeTest.test_absolute_import ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________________ ImportNodeTest.test_as_string _________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________________ ImportNodeTest.test_bad_import_inference ___________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ ImportNodeTest.test_conditional ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________ ImportNodeTest.test_conditional_import ____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________ ImportNodeTest.test_from_self_resolve _____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________________ ImportNodeTest.test_import_self_resolve ____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________________ ImportNodeTest.test_more_absolute_import ___________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________________ ImportNodeTest.test_real_name _________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_nodes.py:481: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _________________ ModuleNodeTest.test_comment_before_docstring _________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ______________________ ModuleNodeTest.test_dict_interface ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ ModuleNodeTest.test_file_stream_api ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s __________________ ModuleNodeTest.test_file_stream_in_memory ___________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________________ ModuleNodeTest.test_file_stream_physical ___________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _________________________ ModuleNodeTest.test_getattr __________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _________________________ ModuleNodeTest.test_import_1 _________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _________________________ ModuleNodeTest.test_import_2 _________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________ ModuleNodeTest.test_import_unavailable_module _________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ______________________ ModuleNodeTest.test_module_getattr ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________________ ModuleNodeTest.test_multiline_docstring ____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _______________________ ModuleNodeTest.test_public_names _______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________ ModuleNodeTest.test_relative_to_absolute_name _________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________ ModuleNodeTest.test_relative_to_absolute_name_beyond_top_level ________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________________ ModuleNodeTest.test_singleline_docstring ___________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________ ModuleNodeTest.test_special_attributes ____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________________ ModuleNodeTest.test_stream_api ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s __________________ ModuleNodeTest.test_wildcard_import_names ___________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________ ModuleNodeTest.test_without_docstring _____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________ FunctionNodeTest.test_abstract_methods_are_not_implicitly_none ________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________________ FunctionNodeTest.test_argnames ________________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ____________________ FunctionNodeTest.test_argnames_lambda _____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________ FunctionNodeTest.test_decorator_builtin_descriptors ______________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ FunctionNodeTest.test_default_value ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________________ FunctionNodeTest.test_dict_interface _____________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ______________________ FunctionNodeTest.test_display_type ______________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ________________ FunctionNodeTest.test_docstring_special_cases _________________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s ___________ FunctionNodeTest.test_dunder_class_local_to_classmethod ____________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:181: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 178s parsed = parser_module.parse( 178s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 178s return ast.parse(string, filename=filename, type_comments=type_comments) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s 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' 178s filename = 'data.module', mode = 'exec' 178s 178s def parse(source, filename='', mode='exec', *, 178s type_comments=False, feature_version=None, optimize=-1): 178s """ 178s Parse the source into an AST node. 178s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 178s Pass type_comments=True to get back type comments where the syntax allows. 178s """ 178s flags = PyCF_ONLY_AST 178s if optimize > 0: 178s flags |= PyCF_OPTIMIZED_AST 178s if type_comments: 178s flags |= PyCF_TYPE_COMMENTS 178s if feature_version is None: 178s feature_version = -1 178s elif isinstance(feature_version, tuple): 178s major, minor = feature_version # Should be a 2-tuple. 178s if major != 3: 178s raise ValueError(f"Unsupported major version: {major}") 178s feature_version = minor 178s # Else it should be an int giving the minor version for 3.x. 178s > return compile(source, filename, mode, flags, 178s _feature_version=feature_version, optimize=optimize) 178s E File "data.module", line 62 178s E SyntaxError: 'return' in a 'finally' block 178s 178s /usr/lib/python3.14/ast.py:46: SyntaxError 178s 178s The above exception was the direct cause of the following exception: 178s 178s self = 178s 178s def setUp(self) -> None: 178s super().setUp() 178s > self.module = resources.build_file("data/module.py", "data.module") 178s 178s tests/test_scoped_nodes.py:73: 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s tests/resources.py:23: in build_file 178s return builder.AstroidBuilder().file_build(find(path), modname) 178s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 178s module, builder = self._data_build(data, modname, path) 178s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 178s ) 178s except (TypeError, ValueError, SyntaxError) as exc: 178s > raise AstroidSyntaxError( 178s "Parsing Python code failed:\n{error}", 178s source=data, 178s modname=modname, 178s path=path, 178s error=exc, 178s ) from exc 178s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 178s E 'return' in a 'finally' block (data.module, line 62) 178s 178s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 178s _____________ FunctionNodeTest.test_dunder_class_local_to_function _____________ 178s 178s self = 178s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 178s modname = 'data.module' 178s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 178s 178s def _data_build( 178s self, data: str, modname: str, path: str | None 178s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 178s """Build tree node from data and add some informations.""" 178s try: 178s > node, parser_module = _parse_string( 178s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________ FunctionNodeTest.test_dunder_class_local_to_method ______________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ FunctionNodeTest.test_format_args _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________ FunctionNodeTest.test_format_args_keyword_only_args ______________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ FunctionNodeTest.test_four_args ________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________ FunctionNodeTest.test_func_instance_attr ___________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________________ FunctionNodeTest.test_func_is_bound ______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ________________________ FunctionNodeTest.test_igetattr ________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ FunctionNodeTest.test_inference_error _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ FunctionNodeTest.test_is_abstract _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ FunctionNodeTest.test_is_abstract_decorated __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ FunctionNodeTest.test_is_generator ______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ FunctionNodeTest.test_is_method ________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________________ FunctionNodeTest.test_lambda_getattr _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________________ FunctionNodeTest.test_lambda_pytype ______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ FunctionNodeTest.test_lambda_qname ______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________ FunctionNodeTest.test_method_init_subclass __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________ FunctionNodeTest.test_multiline_docstring ___________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________ FunctionNodeTest.test_multiline_docstring_async ________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ FunctionNodeTest.test_navigation _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________ FunctionNodeTest.test_no_returns_is_implicitly_none ______________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________ FunctionNodeTest.test_only_raises_is_not_implicitly_none ___________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ________________ FunctionNodeTest.test_positional_only_argnames ________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________ FunctionNodeTest.test_return_annotation_is_not_the_last ____________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________________ FunctionNodeTest.test_return_nothing _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________ FunctionNodeTest.test_singleline_docstring __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________ FunctionNodeTest.test_special_attributes ___________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________ FunctionNodeTest.test_type_builtin_descriptor_subclasses ___________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________ FunctionNodeTest.test_without_docstring ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________________ ClassNodeTest.test__bases__attribute _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ ClassNodeTest.test__mro__attribute ______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_add_metaclass _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_all_ancestors_need_slots __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________________ ClassNodeTest.test_ancestors _________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________ ClassNodeTest.test_class_extra_decorators ___________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________ ClassNodeTest.test_class_extra_decorators_frame_is_not_class _________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _ ClassNodeTest.test_class_extra_decorators_only_assignment_names_are_considered _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____ ClassNodeTest.test_class_extra_decorators_only_callfunc_are_considered ____ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____ ClassNodeTest.test_class_extra_decorators_only_same_name_considered ______ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_class_getattr _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ ClassNodeTest.test_class_keywords _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________ ClassNodeTest.test_classmethod_attributes ___________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_cls_special_attributes_1 __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_cls_special_attributes_2 __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ ClassNodeTest.test_dict_interface _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ________________ ClassNodeTest.test_duplicate_bases_namedtuple _________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______ ClassNodeTest.test_extra_decorators_only_class_level_assignments _______ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________ ClassNodeTest.test_function_with_decorator_lineno _______________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________ ClassNodeTest.test_generator_from_infer_call_result_parent __________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________ ClassNodeTest.test_getattr_from_grandpa ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_getattr_method_transform __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________ ClassNodeTest.test_getattr_with_enpty_annassign ________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_has_dynamic_getattr ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_implicit_metaclass _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_implicit_metaclass_lookup _________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_inner_classes _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________ ClassNodeTest.test_instance_attr_ancestors __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________ ClassNodeTest.test_instance_bound_method_lambdas _______________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________ ClassNodeTest.test_instance_bound_method_lambdas_2 ______________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________________ ClassNodeTest.test_instance_getattr ______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________ ClassNodeTest.test_instance_getattr_with_class_attr ______________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ________________ ClassNodeTest.test_instance_special_attributes ________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ________________________ ClassNodeTest.test_kite_graph _________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________ ClassNodeTest.test_local_attr_ancestors ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________ ClassNodeTest.test_local_attr_invalid_mro ___________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ ClassNodeTest.test_local_attr_mro _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ ClassNodeTest.test_metaclass_error ______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_metaclass_generator_hack __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________ ClassNodeTest.test_metaclass_generator_hack_enum_base _____________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________________ ClassNodeTest.test_metaclass_lookup ______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________ ClassNodeTest.test_metaclass_lookup_inference_errors _____________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________ ClassNodeTest.test_metaclass_lookup_using_same_class _____________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ______________________ ClassNodeTest.test_metaclass_type _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_metaclass_yes_leak _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________________ ClassNodeTest.test_methods __________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________________ ClassNodeTest.test_mro ____________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_mro_generic_1 _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_mro_generic_2 _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_mro_generic_3 _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_mro_generic_4 _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_mro_generic_5 _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_mro_generic_6 _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _______________________ ClassNodeTest.test_mro_generic_7 _______________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_mro_generic_error_1 ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_mro_generic_error_2 ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________ ClassNodeTest.test_mro_typing_extensions ___________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ________________ ClassNodeTest.test_mro_with_attribute_classes _________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_mro_with_factories _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_multiline_docstring ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ________________________ ClassNodeTest.test_navigation _________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ________________ ClassNodeTest.test_no_infinite_metaclass_loop _________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________ ClassNodeTest.test_no_infinite_metaclass_loop_with_redefine __________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_nonregr_infer_callresult __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________ ClassNodeTest.test_singleline_docstring ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________________ ClassNodeTest.test_slots ___________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________ ClassNodeTest.test_slots_added_dynamically_still_inferred ___________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_slots_empty_list_of_slots _________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_slots_for_dict_keys ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _________________ ClassNodeTest.test_slots_taken_from_parents __________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________________ ClassNodeTest.test_type ____________________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________________ ClassNodeTest.test_type_three_arguments ____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ___________ ClassNodeTest.test_using_invalid_six_add_metaclass_call ____________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s __________________ ClassNodeTest.test_with_invalid_metaclass ___________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s ____________________ ClassNodeTest.test_with_metaclass_mro _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s _____________________ ClassNodeTest.test_without_docstring _____________________ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s > node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:181: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 179s parsed = parser_module.parse( 179s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 179s return ast.parse(string, filename=filename, type_comments=type_comments) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s 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' 179s filename = 'data.module', mode = 'exec' 179s 179s def parse(source, filename='', mode='exec', *, 179s type_comments=False, feature_version=None, optimize=-1): 179s """ 179s Parse the source into an AST node. 179s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 179s Pass type_comments=True to get back type comments where the syntax allows. 179s """ 179s flags = PyCF_ONLY_AST 179s if optimize > 0: 179s flags |= PyCF_OPTIMIZED_AST 179s if type_comments: 179s flags |= PyCF_TYPE_COMMENTS 179s if feature_version is None: 179s feature_version = -1 179s elif isinstance(feature_version, tuple): 179s major, minor = feature_version # Should be a 2-tuple. 179s if major != 3: 179s raise ValueError(f"Unsupported major version: {major}") 179s feature_version = minor 179s # Else it should be an int giving the minor version for 3.x. 179s > return compile(source, filename, mode, flags, 179s _feature_version=feature_version, optimize=optimize) 179s E File "data.module", line 62 179s E SyntaxError: 'return' in a 'finally' block 179s 179s /usr/lib/python3.14/ast.py:46: SyntaxError 179s 179s The above exception was the direct cause of the following exception: 179s 179s self = 179s 179s def setUp(self) -> None: 179s super().setUp() 179s > self.module = resources.build_file("data/module.py", "data.module") 179s 179s tests/test_scoped_nodes.py:73: 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s tests/resources.py:23: in build_file 179s return builder.AstroidBuilder().file_build(find(path), modname) 179s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 179s module, builder = self._data_build(data, modname, path) 179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 179s 179s self = 179s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 179s modname = 'data.module' 179s path = '/tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 179s 179s def _data_build( 179s self, data: str, modname: str, path: str | None 179s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 179s """Build tree node from data and add some informations.""" 179s try: 179s node, parser_module = _parse_string( 179s data, type_comments=True, modname=modname 179s ) 179s except (TypeError, ValueError, SyntaxError) as exc: 179s > raise AstroidSyntaxError( 179s "Parsing Python code failed:\n{error}", 179s source=data, 179s modname=modname, 179s path=path, 179s error=exc, 179s ) from exc 179s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 179s E 'return' in a 'finally' block (data.module, line 62) 179s 179s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 179s =========================== short test summary info ============================ 179s FAILED tests/brain/test_brain.py::TypingBrain::test_has_dunder_args - Asserti... 179s FAILED tests/brain/test_brain.py::TypingBrain::test_typing_types - AssertionE... 179s FAILED tests/brain/test_pathlib.py::test_inference_parents - AssertionError: ... 179s FAILED tests/brain/test_pathlib.py::test_inference_parents_subscript_index - ... 179s FAILED tests/test_builder.py::FileBuildTest::test_class_base_props - astroid.... 179s FAILED tests/test_builder.py::FileBuildTest::test_class_basenames - astroid.e... 179s FAILED tests/test_builder.py::FileBuildTest::test_class_instance_attrs - astr... 179s FAILED tests/test_builder.py::FileBuildTest::test_class_locals - astroid.exce... 179s FAILED tests/test_builder.py::FileBuildTest::test_function_base_props - astro... 179s FAILED tests/test_builder.py::FileBuildTest::test_function_locals - astroid.e... 179s FAILED tests/test_builder.py::FileBuildTest::test_method_base_props - astroid... 179s FAILED tests/test_builder.py::FileBuildTest::test_method_locals - astroid.exc... 179s FAILED tests/test_builder.py::FileBuildTest::test_module_base_props - astroid... 179s FAILED tests/test_builder.py::FileBuildTest::test_module_locals - astroid.exc... 179s FAILED tests/test_builder.py::FileBuildTest::test_unknown_encoding - astroid.... 179s FAILED tests/test_inference.py::InferenceTest::test_binary_op_or_union_type 179s FAILED tests/test_lookup.py::LookupTest::test_builtin_lookup - astroid.except... 179s FAILED tests/test_lookup.py::LookupTest::test_class - astroid.exceptions.Astr... 179s FAILED tests/test_lookup.py::LookupTest::test_class_ancestor_name - astroid.e... 179s FAILED tests/test_lookup.py::LookupTest::test_class_in_function - astroid.exc... 179s FAILED tests/test_lookup.py::LookupTest::test_class_variables - astroid.excep... 179s FAILED tests/test_lookup.py::LookupTest::test_decorator_arguments_lookup - as... 179s FAILED tests/test_lookup.py::LookupTest::test_dict_comp_nested - astroid.exce... 179s FAILED tests/test_lookup.py::LookupTest::test_dict_comps - astroid.exceptions... 179s FAILED tests/test_lookup.py::LookupTest::test_explicit___name__ - astroid.exc... 179s FAILED tests/test_lookup.py::LookupTest::test_function_argument_with_default 179s FAILED tests/test_lookup.py::LookupTest::test_function_module_special - astro... 179s FAILED tests/test_lookup.py::LookupTest::test_function_nested - astroid.excep... 179s FAILED tests/test_lookup.py::LookupTest::test_generator_attributes - astroid.... 179s FAILED tests/test_lookup.py::LookupTest::test_global_delete - astroid.excepti... 179s FAILED tests/test_lookup.py::LookupTest::test_inner_classes - astroid.excepti... 179s FAILED tests/test_lookup.py::LookupTest::test_inner_decorator_member_lookup 179s FAILED tests/test_lookup.py::LookupTest::test_lambda_nested - astroid.excepti... 179s FAILED tests/test_lookup.py::LookupTest::test_limit - astroid.exceptions.Astr... 179s FAILED tests/test_lookup.py::LookupTest::test_list_comp_nested - astroid.exce... 179s FAILED tests/test_lookup.py::LookupTest::test_list_comp_target - astroid.exce... 179s FAILED tests/test_lookup.py::LookupTest::test_list_comps - astroid.exceptions... 179s FAILED tests/test_lookup.py::LookupTest::test_loopvar_hiding - astroid.except... 179s FAILED tests/test_lookup.py::LookupTest::test_method - astroid.exceptions.Ast... 179s FAILED tests/test_lookup.py::LookupTest::test_module - astroid.exceptions.Ast... 179s FAILED tests/test_lookup.py::LookupTest::test_set_comp_closure - astroid.exce... 179s FAILED tests/test_lookup.py::LookupTest::test_set_comp_nested - astroid.excep... 179s FAILED tests/test_lookup.py::LookupTest::test_set_comps - astroid.exceptions.... 179s FAILED tests/test_lookup.py::LookupTest::test_static_method_lookup - astroid.... 179s FAILED tests/test_nodes.py::AsStringTest::test_module_as_string - astroid.exc... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_absolute_import - astroid.ex... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_as_string - astroid.exceptio... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_bad_import_inference - astro... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_conditional - astroid.except... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_conditional_import - astroid... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_from_self_resolve - astroid.... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_import_self_resolve - astroi... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_more_absolute_import - astro... 179s FAILED tests/test_nodes.py::ImportNodeTest::test_real_name - astroid.exceptio... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_comment_before_docstring 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_dict_interface - astr... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_api - ast... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_in_memory 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_physical 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_getattr - astroid.exc... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_1 - astroid.ex... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_2 - astroid.ex... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_unavailable_module 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_module_getattr - astr... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_multiline_docstring 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_public_names - astroi... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_relative_to_absolute_name 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_relative_to_absolute_name_beyond_top_level 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_singleline_docstring 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_special_attributes - ... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_stream_api - astroid.... 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_wildcard_import_names 179s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_without_docstring - a... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_abstract_methods_are_not_implicitly_none 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_argnames - astroid.... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_argnames_lambda - a... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_decorator_builtin_descriptors 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_default_value - ast... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dict_interface - as... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_display_type - astr... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_docstring_special_cases 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_classmethod 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_function 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_method 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_format_args - astro... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_format_args_keyword_only_args 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_four_args - astroid... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_func_instance_attr 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_func_is_bound - ast... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_igetattr - astroid.... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_inference_error - a... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_abstract - astro... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_abstract_decorated 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_generator - astr... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_method - astroid... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_getattr - as... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_pytype - ast... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_qname - astr... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_method_init_subclass 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_multiline_docstring 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_multiline_docstring_async 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_navigation - astroi... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_no_returns_is_implicitly_none 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_only_raises_is_not_implicitly_none 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_positional_only_argnames 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_return_annotation_is_not_the_last 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_return_nothing - as... 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_singleline_docstring 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_special_attributes 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_type_builtin_descriptor_subclasses 179s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_without_docstring 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test__bases__attribute - as... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test__mro__attribute - astr... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_add_metaclass - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_all_ancestors_need_slots 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_ancestors - astroid.ex... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_frame_is_not_class 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_assignment_names_are_considered 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_callfunc_are_considered 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_same_name_considered 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_getattr - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_keywords - astro... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_classmethod_attributes 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_cls_special_attributes_1 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_cls_special_attributes_2 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_dict_interface - astro... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_duplicate_bases_namedtuple 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_extra_decorators_only_class_level_assignments 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_function_with_decorator_lineno 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_generator_from_infer_call_result_parent 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_from_grandpa 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_method_transform 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_with_enpty_annassign 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_has_dynamic_getattr - ... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_implicit_metaclass - a... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_implicit_metaclass_lookup 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_inner_classes - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_attr_ancestors 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_bound_method_lambdas 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_bound_method_lambdas_2 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_getattr - ast... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_getattr_with_class_attr 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_special_attributes 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_kite_graph - astroid.e... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_ancestors 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_invalid_mro 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_mro - astro... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_error - astr... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_generator_hack 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_generator_hack_enum_base 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup - ast... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup_inference_errors 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup_using_same_class 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_type - astro... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_yes_leak - a... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_methods - astroid.exce... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro - astroid.exceptio... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_1 - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_2 - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_3 - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_4 - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_5 - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_6 - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_7 - astroi... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_error_1 - ... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_error_2 - ... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_typing_extensions 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_with_attribute_classes 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_with_factories - a... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_multiline_docstring - ... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_navigation - astroid.e... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_no_infinite_metaclass_loop 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_no_infinite_metaclass_loop_with_redefine 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_nonregr_infer_callresult 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_singleline_docstring 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots - astroid.except... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_added_dynamically_still_inferred 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_empty_list_of_slots 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_for_dict_keys - ... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_taken_from_parents 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_type - astroid.excepti... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_type_three_arguments 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_using_invalid_six_add_metaclass_call 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_with_invalid_metaclass 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_with_metaclass_mro - a... 179s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_without_docstring - as... 179s ===== 187 failed, 1452 passed, 54 skipped, 15 xfailed in 73.56s (0:01:13) ====== 180s E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build; python3.14 -m pytest tests 180s I: pybuild base:311: cd /tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build; python3.13 -m pytest tests 184s ============================= test session starts ============================== 184s platform linux -- Python 3.13.9, pytest-8.3.5, pluggy-1.6.0 184s rootdir: /tmp/autopkgtest.Mz9Ad0/autopkgtest_tmp/build 184s configfile: pyproject.toml 184s plugins: typeguard-4.4.2 184s collected 1708 items 184s 184s tests/brain/numpy/test_core_einsumfunc.py ss [ 0%] 184s tests/brain/numpy/test_core_fromnumeric.py s [ 0%] 184s tests/brain/numpy/test_core_function_base.py s [ 0%] 184s tests/brain/numpy/test_core_multiarray.py sssss [ 0%] 184s tests/brain/numpy/test_core_numeric.py sssss [ 0%] 184s tests/brain/numpy/test_core_numerictypes.py sssssss.. [ 1%] 184s tests/brain/numpy/test_core_umath.py ssssssss [ 1%] 184s tests/brain/numpy/test_ma.py ssss [ 2%] 184s tests/brain/numpy/test_ndarray.py sss [ 2%] 184s tests/brain/numpy/test_random_mtrand.py ss [ 2%] 184s tests/brain/test_argparse.py . [ 2%] 185s tests/brain/test_attr.py ....... [ 2%] 186s tests/brain/test_brain.py ......s.....ss................................ [ 5%] 186s ............s.........................................................x. [ 9%] 187s ..............s...... [ 10%] 187s tests/brain/test_builtin.py .................. [ 12%] 187s tests/brain/test_ctypes.py ....x........................ [ 13%] 187s tests/brain/test_dataclasses.py ........................................ [ 16%] 187s ......................................x... [ 18%] 187s tests/brain/test_dateutil.py . [ 18%] 187s tests/brain/test_enum.py ............................. [ 20%] 187s tests/brain/test_hashlib.py ... [ 20%] 187s tests/brain/test_multiprocessing.py ... [ 20%] 188s tests/brain/test_named_tuple.py ....................... [ 21%] 188s tests/brain/test_nose.py s [ 22%] 188s tests/brain/test_pathlib.py .... [ 22%] 188s tests/brain/test_pytest.py . [ 22%] 188s tests/brain/test_qt.py sss [ 22%] 188s tests/brain/test_regex.py ss [ 22%] 188s tests/brain/test_signal.py ... [ 22%] 190s tests/brain/test_six.py ....... [ 23%] 190s tests/brain/test_ssl.py .. [ 23%] 190s tests/brain/test_threading.py .... [ 23%] 190s tests/brain/test_typing.py ..... [ 23%] 191s tests/brain/test_typing_extensions.py . [ 23%] 191s tests/brain/test_unittest.py . [ 23%] 193s tests/test_builder.py .................................................. [ 26%] 193s ........ [ 27%] 193s tests/test_constraint.py ................................... [ 29%] 193s tests/test_decorators.py ... [ 29%] 193s tests/test_filter_statements.py . [ 29%] 193s tests/test_group_exceptions.py ... [ 29%] 193s tests/test_helpers.py ............... [ 30%] 193s tests/test_inference.py ................................................ [ 33%] 193s ............................................x...........x......x........ [ 37%] 194s ..................................................x..................... [ 41%] 194s ........................................................................ [ 46%] 194s ................................................x........xx............. [ 50%] 195s ........x...x................................................x.......... [ 54%] 195s ................................. [ 56%] 195s tests/test_inference_calls.py ........................ [ 57%] 196s tests/test_lookup.py ................................................... [ 60%] 196s .... [ 61%] 214s tests/test_manager.py .....................................s....... [ 63%] 214s tests/test_modutils.py ................................................. [ 66%] 214s ................s. [ 67%] 216s tests/test_nodes.py .................................................... [ 70%] 216s ........................................................................ [ 74%] 216s ................................................................ [ 78%] 216s tests/test_nodes_lineno.py ....................... [ 80%] 216s tests/test_nodes_position.py ... [ 80%] 216s tests/test_object_model.py x...............x.........s........... [ 82%] 216s tests/test_objects.py ...................... [ 83%] 216s tests/test_protocols.py ..................... [ 84%] 216s tests/test_python3.py .......................... [ 86%] 217s tests/test_raw_building.py ............. [ 87%] 224s tests/test_regrtest.py .............ss............ [ 88%] 225s tests/test_scoped_nodes.py ............................................. [ 91%] 227s ........................................................................ [ 95%] 228s .................................................. [ 98%] 228s tests/test_stdlib.py .. [ 98%] 228s tests/test_transforms.py ......... [ 99%] 228s tests/test_type_params.py ..... [ 99%] 228s tests/test_utils.py ........ [100%] 228s 228s ================ 1639 passed, 54 skipped, 15 xfailed in 47.10s ================= 229s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p "3.14 3.13" returned exit code 13 229s make: *** [/tmp/CjDfynVyog/run:4: pybuild-autopkgtest] Error 25 229s pybuild-autopkgtest: error: /tmp/CjDfynVyog/run pybuild-autopkgtest returned exit code 2 230s autopkgtest [13:35:08]: test pybuild-autopkgtest: -----------------------] 230s pybuild-autopkgtest FAIL non-zero exit status 25 230s autopkgtest [13:35:08]: test pybuild-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 231s autopkgtest [13:35:09]: @@@@@@@@@@@@@@@@@@@@ summary 231s pybuild-autopkgtest FAIL non-zero exit status 25