0s autopkgtest [13:01:12]: starting date and time: 2025-11-17 13:01:12+0000 0s autopkgtest [13:01:12]: git checkout: 4b346b80 nova: make wait_reboot return success even when a no-op 0s autopkgtest [13:01:12]: host juju-7f2275-prod-proposed-migration-environment-2; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.0hgsbsha/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-ppc64el --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-2@bos03-ppc64el-1.secgroup --name adt-resolute-ppc64el-astroid-20251117-130112-juju-7f2275-prod-proposed-migration-environment-2-4898e468-6c5a-4711-bb0a-2fd155a229af --image adt/ubuntu-resolute-ppc64el-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-2 --net-id=net_prod-proposed-migration-ppc64el -e TERM=linux --mirror=http://ftpmaster.internal/ubuntu/ 6s Creating nova instance adt-resolute-ppc64el-astroid-20251117-130112-juju-7f2275-prod-proposed-migration-environment-2-4898e468-6c5a-4711-bb0a-2fd155a229af from image adt/ubuntu-resolute-ppc64el-server-20251117.img (UUID c6f5b741-c77a-45db-84cb-f00b40e77676)... 65s autopkgtest [13:02:17]: testbed dpkg architecture: ppc64el 65s autopkgtest [13:02:17]: testbed apt version: 3.1.11 65s autopkgtest [13:02:17]: @@@@@@@@@@@@@@@@@@@@ test bed setup 65s autopkgtest [13:02:17]: testbed release detected to be: None 66s autopkgtest [13:02:18]: updating testbed package index (apt update) 66s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease [87.8 kB] 67s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 67s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 67s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 67s Get:5 http://ftpmaster.internal/ubuntu resolute-proposed/main Sources [81.1 kB] 67s Get:6 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse Sources [22.9 kB] 67s Get:7 http://ftpmaster.internal/ubuntu resolute-proposed/universe Sources [868 kB] 67s Get:8 http://ftpmaster.internal/ubuntu resolute-proposed/restricted Sources [9848 B] 67s Get:9 http://ftpmaster.internal/ubuntu resolute-proposed/main ppc64el Packages [140 kB] 67s Get:10 http://ftpmaster.internal/ubuntu resolute-proposed/restricted ppc64el Packages [940 B] 67s Get:11 http://ftpmaster.internal/ubuntu resolute-proposed/universe ppc64el Packages [562 kB] 67s Get:12 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse ppc64el Packages [11.0 kB] 68s Fetched 1784 kB in 1s (1309 kB/s) 69s Reading package lists... 69s Hit:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease 70s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 70s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 70s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 71s Reading package lists... 71s Reading package lists... 71s Building dependency tree... 71s Reading state information... 71s Calculating upgrade... 71s The following packages will be upgraded: 71s libpython3-stdlib python3 python3-minimal usbutils 71s 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 71s Need to get 154 kB of archives. 71s After this operation, 0 B of additional disk space will be used. 71s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed/main ppc64el python3-minimal ppc64el 3.13.7-2 [27.8 kB] 71s Get:2 http://ftpmaster.internal/ubuntu resolute-proposed/main ppc64el python3 ppc64el 3.13.7-2 [23.9 kB] 71s Get:3 http://ftpmaster.internal/ubuntu resolute-proposed/main ppc64el libpython3-stdlib ppc64el 3.13.7-2 [10.6 kB] 71s Get:4 http://ftpmaster.internal/ubuntu resolute/main ppc64el usbutils ppc64el 1:019-1 [91.5 kB] 72s dpkg-preconfigure: unable to re-open stdin: No such file or directory 72s Fetched 154 kB in 0s (352 kB/s) 72s (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 ... 81022 files and directories currently installed.) 72s Preparing to unpack .../python3-minimal_3.13.7-2_ppc64el.deb ... 72s Unpacking python3-minimal (3.13.7-2) over (3.13.7-1) ... 73s Setting up python3-minimal (3.13.7-2) ... 73s (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 ... 81022 files and directories currently installed.) 73s Preparing to unpack .../python3_3.13.7-2_ppc64el.deb ... 73s running python pre-rtupdate hooks for python3.13... 73s Unpacking python3 (3.13.7-2) over (3.13.7-1) ... 73s Preparing to unpack .../libpython3-stdlib_3.13.7-2_ppc64el.deb ... 73s Unpacking libpython3-stdlib:ppc64el (3.13.7-2) over (3.13.7-1) ... 73s Preparing to unpack .../usbutils_1%3a019-1_ppc64el.deb ... 73s Unpacking usbutils (1:019-1) over (1:018-2) ... 73s Setting up usbutils (1:019-1) ... 73s Setting up libpython3-stdlib:ppc64el (3.13.7-2) ... 73s Setting up python3 (3.13.7-2) ... 73s running python rtupdate hooks for python3.13... 73s running python post-rtupdate hooks for python3.13... 73s Processing triggers for man-db (2.13.1-1) ... 75s autopkgtest [13:02:27]: upgrading testbed (apt dist-upgrade and autopurge) 75s Reading package lists... 76s Building dependency tree... 76s Reading state information... 76s Calculating upgrade... 76s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 76s Reading package lists... 76s Building dependency tree... 76s Reading state information... 77s Solving dependencies... 77s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 80s autopkgtest [13:02:32]: testbed running kernel: Linux 6.17.0-5-generic #5-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 10:02:41 UTC 2025 80s autopkgtest [13:02:32]: @@@@@@@@@@@@@@@@@@@@ apt-source astroid 82s Get:1 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (dsc) [2268 B] 82s Get:2 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (tar) [467 kB] 82s Get:3 http://ftpmaster.internal/ubuntu resolute/universe astroid 3.3.8-2 (diff) [5604 B] 82s gpgv: Signature made Sun Jan 19 13:16:35 2025 UTC 82s gpgv: using RSA key 8F6DE104377F3B11E741748731F3144544A1741A 82s gpgv: issuer "tchet@debian.org" 82s gpgv: Can't check signature: No public key 82s dpkg-source: warning: cannot verify inline signature for ./astroid_3.3.8-2.dsc: no acceptable signature found 82s autopkgtest [13:02:34]: testing package astroid version 3.3.8-2 83s autopkgtest [13:02:35]: build not needed 83s autopkgtest [13:02:35]: test pybuild-autopkgtest: preparing testbed 84s Reading package lists... 84s Building dependency tree... 84s Reading state information... 84s Solving dependencies... 84s The following NEW packages will be installed: 84s autoconf automake autopoint autotools-dev build-essential cpp cpp-15 84s cpp-15-powerpc64le-linux-gnu cpp-powerpc64le-linux-gnu debhelper debugedit 84s dh-autoreconf dh-python dh-strip-nondeterminism dwz g++ g++-15 84s g++-15-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu gcc gcc-15 84s gcc-15-powerpc64le-linux-gnu gcc-powerpc64le-linux-gnu gettext 84s intltool-debian libarchive-zip-perl libasan8 libcc1-0 libdebhelper-perl 84s libfile-stripnondeterminism-perl libgcc-15-dev libgomp1 libisl23 libitm1 84s liblsan0 libmpc3 libpython3.14-minimal libpython3.14-stdlib libquadmath0 84s libstdc++-15-dev libtool libtsan2 libubsan1 m4 po-debconf 84s pybuild-plugin-autopkgtest pybuild-plugin-pyproject python3-all 84s python3-astroid python3-build python3-iniconfig python3-installer 84s python3-lazy-object-proxy python3-pip python3-pluggy python3-pyproject-hooks 84s python3-pytest python3-pytest-runner python3-wheel python3-wrapt python3.14 84s python3.14-minimal 84s 0 upgraded, 62 newly installed, 0 to remove and 0 not upgraded. 84s Need to get 75.3 MB of archives. 84s After this operation, 277 MB of additional disk space will be used. 84s Get:1 http://ftpmaster.internal/ubuntu resolute/main ppc64el libpython3.14-minimal ppc64el 3.14.0-4 [908 kB] 85s Get:2 http://ftpmaster.internal/ubuntu resolute/main ppc64el python3.14-minimal ppc64el 3.14.0-4 [2705 kB] 86s Get:3 http://ftpmaster.internal/ubuntu resolute/main ppc64el m4 ppc64el 1.4.20-2 [236 kB] 86s Get:4 http://ftpmaster.internal/ubuntu resolute/main ppc64el autoconf all 2.72-3.1ubuntu1 [384 kB] 86s Get:5 http://ftpmaster.internal/ubuntu resolute/main ppc64el autotools-dev all 20240727.1 [43.4 kB] 86s Get:6 http://ftpmaster.internal/ubuntu resolute/main ppc64el automake all 1:1.18.1-2 [581 kB] 86s Get:7 http://ftpmaster.internal/ubuntu resolute/main ppc64el autopoint all 0.23.2-1 [620 kB] 86s Get:8 http://ftpmaster.internal/ubuntu resolute/main ppc64el libisl23 ppc64el 0.27-1 [882 kB] 87s Get:9 http://ftpmaster.internal/ubuntu resolute/main ppc64el libmpc3 ppc64el 1.3.1-2 [62.5 kB] 87s Get:10 http://ftpmaster.internal/ubuntu resolute/main ppc64el cpp-15-powerpc64le-linux-gnu ppc64el 15.2.0-7ubuntu1 [11.4 MB] 91s Get:11 http://ftpmaster.internal/ubuntu resolute/main ppc64el cpp-15 ppc64el 15.2.0-7ubuntu1 [1032 B] 91s Get:12 http://ftpmaster.internal/ubuntu resolute/main ppc64el cpp-powerpc64le-linux-gnu ppc64el 4:15.2.0-4ubuntu1 [5746 B] 91s Get:13 http://ftpmaster.internal/ubuntu resolute/main ppc64el cpp ppc64el 4:15.2.0-4ubuntu1 [22.4 kB] 91s Get:14 http://ftpmaster.internal/ubuntu resolute/main ppc64el libcc1-0 ppc64el 15.2.0-7ubuntu1 [49.0 kB] 91s Get:15 http://ftpmaster.internal/ubuntu resolute/main ppc64el libgomp1 ppc64el 15.2.0-7ubuntu1 [169 kB] 91s Get:16 http://ftpmaster.internal/ubuntu resolute/main ppc64el libitm1 ppc64el 15.2.0-7ubuntu1 [32.3 kB] 91s Get:17 http://ftpmaster.internal/ubuntu resolute/main ppc64el libasan8 ppc64el 15.2.0-7ubuntu1 [3006 kB] 92s Get:18 http://ftpmaster.internal/ubuntu resolute/main ppc64el liblsan0 ppc64el 15.2.0-7ubuntu1 [1374 kB] 92s Get:19 http://ftpmaster.internal/ubuntu resolute/main ppc64el libtsan2 ppc64el 15.2.0-7ubuntu1 [2728 kB] 93s Get:20 http://ftpmaster.internal/ubuntu resolute/main ppc64el libubsan1 ppc64el 15.2.0-7ubuntu1 [1231 kB] 94s Get:21 http://ftpmaster.internal/ubuntu resolute/main ppc64el libquadmath0 ppc64el 15.2.0-7ubuntu1 [160 kB] 94s Get:22 http://ftpmaster.internal/ubuntu resolute/main ppc64el libgcc-15-dev ppc64el 15.2.0-7ubuntu1 [1670 kB] 94s Get:23 http://ftpmaster.internal/ubuntu resolute/main ppc64el gcc-15-powerpc64le-linux-gnu ppc64el 15.2.0-7ubuntu1 [22.4 MB] 98s Get:24 http://ftpmaster.internal/ubuntu resolute/main ppc64el gcc-15 ppc64el 15.2.0-7ubuntu1 [524 kB] 98s Get:25 http://ftpmaster.internal/ubuntu resolute/main ppc64el gcc-powerpc64le-linux-gnu ppc64el 4:15.2.0-4ubuntu1 [1220 B] 98s Get:26 http://ftpmaster.internal/ubuntu resolute/main ppc64el gcc ppc64el 4:15.2.0-4ubuntu1 [5032 B] 98s Get:27 http://ftpmaster.internal/ubuntu resolute/main ppc64el libstdc++-15-dev ppc64el 15.2.0-7ubuntu1 [2744 kB] 99s Get:28 http://ftpmaster.internal/ubuntu resolute/main ppc64el g++-15-powerpc64le-linux-gnu ppc64el 15.2.0-7ubuntu1 [13.0 MB] 100s Get:29 http://ftpmaster.internal/ubuntu resolute/main ppc64el g++-15 ppc64el 15.2.0-7ubuntu1 [23.7 kB] 100s Get:30 http://ftpmaster.internal/ubuntu resolute/main ppc64el g++-powerpc64le-linux-gnu ppc64el 4:15.2.0-4ubuntu1 [970 B] 100s Get:31 http://ftpmaster.internal/ubuntu resolute/main ppc64el g++ ppc64el 4:15.2.0-4ubuntu1 [1092 B] 100s Get:32 http://ftpmaster.internal/ubuntu resolute/main ppc64el build-essential ppc64el 12.12ubuntu1 [5094 B] 100s Get:33 http://ftpmaster.internal/ubuntu resolute/main ppc64el libdebhelper-perl all 13.24.2ubuntu1 [95.7 kB] 100s Get:34 http://ftpmaster.internal/ubuntu resolute/main ppc64el libtool all 2.5.4-7 [169 kB] 100s Get:35 http://ftpmaster.internal/ubuntu resolute/main ppc64el dh-autoreconf all 21 [12.5 kB] 100s Get:36 http://ftpmaster.internal/ubuntu resolute/main ppc64el libarchive-zip-perl all 1.68-1 [90.2 kB] 100s Get:37 http://ftpmaster.internal/ubuntu resolute/main ppc64el libfile-stripnondeterminism-perl all 1.15.0-1 [20.5 kB] 100s Get:38 http://ftpmaster.internal/ubuntu resolute/main ppc64el dh-strip-nondeterminism all 1.15.0-1 [5090 B] 100s Get:39 http://ftpmaster.internal/ubuntu resolute/main ppc64el debugedit ppc64el 1:5.2-3 [57.3 kB] 100s Get:40 http://ftpmaster.internal/ubuntu resolute/main ppc64el dwz ppc64el 0.16-2 [142 kB] 100s Get:41 http://ftpmaster.internal/ubuntu resolute/main ppc64el gettext ppc64el 0.23.2-1 [1177 kB] 100s Get:42 http://ftpmaster.internal/ubuntu resolute/main ppc64el intltool-debian all 0.35.0+20060710.6 [23.2 kB] 100s Get:43 http://ftpmaster.internal/ubuntu resolute/main ppc64el po-debconf all 1.0.21+nmu1 [233 kB] 100s Get:44 http://ftpmaster.internal/ubuntu resolute/main ppc64el debhelper all 13.24.2ubuntu1 [896 kB] 100s Get:45 http://ftpmaster.internal/ubuntu resolute/universe ppc64el dh-python all 6.20250414 [119 kB] 100s Get:46 http://ftpmaster.internal/ubuntu resolute/main ppc64el libpython3.14-stdlib ppc64el 3.14.0-4 [2446 kB] 101s Get:47 http://ftpmaster.internal/ubuntu resolute/universe ppc64el pybuild-plugin-autopkgtest all 6.20250414 [1746 B] 101s Get:48 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-pyproject-hooks all 1.2.0-1 [10.2 kB] 101s Get:49 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-wheel all 0.46.1-2 [22.1 kB] 101s Get:50 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-build all 1.2.2-4 [31.0 kB] 101s Get:51 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-installer all 0.7.0+dfsg1-3 [17.4 kB] 101s Get:52 http://ftpmaster.internal/ubuntu resolute/universe ppc64el pybuild-plugin-pyproject all 6.20250414 [1728 B] 101s Get:53 http://ftpmaster.internal/ubuntu resolute/main ppc64el python3.14 ppc64el 3.14.0-4 [805 kB] 101s Get:54 http://ftpmaster.internal/ubuntu resolute-proposed/main ppc64el python3-all ppc64el 3.13.7-2 [892 B] 101s Get:55 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-astroid all 3.3.8-2 [175 kB] 101s Get:56 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-iniconfig all 2.1.0-1 [6840 B] 101s Get:57 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-lazy-object-proxy ppc64el 1.12.0-1 [27.0 kB] 101s Get:58 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-pip all 25.1.1+dfsg-1ubuntu2 [1416 kB] 101s Get:59 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-pluggy all 1.6.0-1 [21.0 kB] 101s Get:60 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-pytest all 8.3.5-2 [252 kB] 101s Get:61 http://ftpmaster.internal/ubuntu resolute/universe ppc64el python3-pytest-runner all 2.11.1-5 [7592 B] 101s Get:62 http://ftpmaster.internal/ubuntu resolute/main ppc64el python3-wrapt ppc64el 1.17.3-2 [42.0 kB] 101s Fetched 75.3 MB in 17s (4426 kB/s) 101s Selecting previously unselected package libpython3.14-minimal:ppc64el. 101s (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 ... 81022 files and directories currently installed.) 102s Preparing to unpack .../00-libpython3.14-minimal_3.14.0-4_ppc64el.deb ... 102s Unpacking libpython3.14-minimal:ppc64el (3.14.0-4) ... 102s Selecting previously unselected package python3.14-minimal. 102s Preparing to unpack .../01-python3.14-minimal_3.14.0-4_ppc64el.deb ... 102s Unpacking python3.14-minimal (3.14.0-4) ... 102s Selecting previously unselected package m4. 102s Preparing to unpack .../02-m4_1.4.20-2_ppc64el.deb ... 102s Unpacking m4 (1.4.20-2) ... 102s Selecting previously unselected package autoconf. 102s Preparing to unpack .../03-autoconf_2.72-3.1ubuntu1_all.deb ... 102s Unpacking autoconf (2.72-3.1ubuntu1) ... 102s Selecting previously unselected package autotools-dev. 102s Preparing to unpack .../04-autotools-dev_20240727.1_all.deb ... 102s Unpacking autotools-dev (20240727.1) ... 102s Selecting previously unselected package automake. 102s Preparing to unpack .../05-automake_1%3a1.18.1-2_all.deb ... 102s Unpacking automake (1:1.18.1-2) ... 102s Selecting previously unselected package autopoint. 102s Preparing to unpack .../06-autopoint_0.23.2-1_all.deb ... 102s Unpacking autopoint (0.23.2-1) ... 102s Selecting previously unselected package libisl23:ppc64el. 102s Preparing to unpack .../07-libisl23_0.27-1_ppc64el.deb ... 102s Unpacking libisl23:ppc64el (0.27-1) ... 102s Selecting previously unselected package libmpc3:ppc64el. 102s Preparing to unpack .../08-libmpc3_1.3.1-2_ppc64el.deb ... 102s Unpacking libmpc3:ppc64el (1.3.1-2) ... 102s Selecting previously unselected package cpp-15-powerpc64le-linux-gnu. 102s Preparing to unpack .../09-cpp-15-powerpc64le-linux-gnu_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking cpp-15-powerpc64le-linux-gnu (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package cpp-15. 102s Preparing to unpack .../10-cpp-15_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking cpp-15 (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package cpp-powerpc64le-linux-gnu. 102s Preparing to unpack .../11-cpp-powerpc64le-linux-gnu_4%3a15.2.0-4ubuntu1_ppc64el.deb ... 102s Unpacking cpp-powerpc64le-linux-gnu (4:15.2.0-4ubuntu1) ... 102s Selecting previously unselected package cpp. 102s Preparing to unpack .../12-cpp_4%3a15.2.0-4ubuntu1_ppc64el.deb ... 102s Unpacking cpp (4:15.2.0-4ubuntu1) ... 102s Selecting previously unselected package libcc1-0:ppc64el. 102s Preparing to unpack .../13-libcc1-0_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking libcc1-0:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package libgomp1:ppc64el. 102s Preparing to unpack .../14-libgomp1_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking libgomp1:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package libitm1:ppc64el. 102s Preparing to unpack .../15-libitm1_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking libitm1:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package libasan8:ppc64el. 102s Preparing to unpack .../16-libasan8_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking libasan8:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package liblsan0:ppc64el. 102s Preparing to unpack .../17-liblsan0_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking liblsan0:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package libtsan2:ppc64el. 102s Preparing to unpack .../18-libtsan2_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking libtsan2:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package libubsan1:ppc64el. 102s Preparing to unpack .../19-libubsan1_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking libubsan1:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package libquadmath0:ppc64el. 102s Preparing to unpack .../20-libquadmath0_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking libquadmath0:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package libgcc-15-dev:ppc64el. 102s Preparing to unpack .../21-libgcc-15-dev_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking libgcc-15-dev:ppc64el (15.2.0-7ubuntu1) ... 102s Selecting previously unselected package gcc-15-powerpc64le-linux-gnu. 102s Preparing to unpack .../22-gcc-15-powerpc64le-linux-gnu_15.2.0-7ubuntu1_ppc64el.deb ... 102s Unpacking gcc-15-powerpc64le-linux-gnu (15.2.0-7ubuntu1) ... 103s Selecting previously unselected package gcc-15. 103s Preparing to unpack .../23-gcc-15_15.2.0-7ubuntu1_ppc64el.deb ... 103s Unpacking gcc-15 (15.2.0-7ubuntu1) ... 103s Selecting previously unselected package gcc-powerpc64le-linux-gnu. 103s Preparing to unpack .../24-gcc-powerpc64le-linux-gnu_4%3a15.2.0-4ubuntu1_ppc64el.deb ... 103s Unpacking gcc-powerpc64le-linux-gnu (4:15.2.0-4ubuntu1) ... 103s Selecting previously unselected package gcc. 103s Preparing to unpack .../25-gcc_4%3a15.2.0-4ubuntu1_ppc64el.deb ... 103s Unpacking gcc (4:15.2.0-4ubuntu1) ... 103s Selecting previously unselected package libstdc++-15-dev:ppc64el. 103s Preparing to unpack .../26-libstdc++-15-dev_15.2.0-7ubuntu1_ppc64el.deb ... 103s Unpacking libstdc++-15-dev:ppc64el (15.2.0-7ubuntu1) ... 103s Selecting previously unselected package g++-15-powerpc64le-linux-gnu. 103s Preparing to unpack .../27-g++-15-powerpc64le-linux-gnu_15.2.0-7ubuntu1_ppc64el.deb ... 103s Unpacking g++-15-powerpc64le-linux-gnu (15.2.0-7ubuntu1) ... 103s Selecting previously unselected package g++-15. 103s Preparing to unpack .../28-g++-15_15.2.0-7ubuntu1_ppc64el.deb ... 103s Unpacking g++-15 (15.2.0-7ubuntu1) ... 103s Selecting previously unselected package g++-powerpc64le-linux-gnu. 103s Preparing to unpack .../29-g++-powerpc64le-linux-gnu_4%3a15.2.0-4ubuntu1_ppc64el.deb ... 103s Unpacking g++-powerpc64le-linux-gnu (4:15.2.0-4ubuntu1) ... 103s Selecting previously unselected package g++. 103s Preparing to unpack .../30-g++_4%3a15.2.0-4ubuntu1_ppc64el.deb ... 103s Unpacking g++ (4:15.2.0-4ubuntu1) ... 103s Selecting previously unselected package build-essential. 103s Preparing to unpack .../31-build-essential_12.12ubuntu1_ppc64el.deb ... 103s Unpacking build-essential (12.12ubuntu1) ... 103s Selecting previously unselected package libdebhelper-perl. 103s Preparing to unpack .../32-libdebhelper-perl_13.24.2ubuntu1_all.deb ... 103s Unpacking libdebhelper-perl (13.24.2ubuntu1) ... 103s Selecting previously unselected package libtool. 103s Preparing to unpack .../33-libtool_2.5.4-7_all.deb ... 103s Unpacking libtool (2.5.4-7) ... 103s Selecting previously unselected package dh-autoreconf. 103s Preparing to unpack .../34-dh-autoreconf_21_all.deb ... 103s Unpacking dh-autoreconf (21) ... 103s Selecting previously unselected package libarchive-zip-perl. 103s Preparing to unpack .../35-libarchive-zip-perl_1.68-1_all.deb ... 103s Unpacking libarchive-zip-perl (1.68-1) ... 103s Selecting previously unselected package libfile-stripnondeterminism-perl. 103s Preparing to unpack .../36-libfile-stripnondeterminism-perl_1.15.0-1_all.deb ... 103s Unpacking libfile-stripnondeterminism-perl (1.15.0-1) ... 103s Selecting previously unselected package dh-strip-nondeterminism. 103s Preparing to unpack .../37-dh-strip-nondeterminism_1.15.0-1_all.deb ... 103s Unpacking dh-strip-nondeterminism (1.15.0-1) ... 103s Selecting previously unselected package debugedit. 103s Preparing to unpack .../38-debugedit_1%3a5.2-3_ppc64el.deb ... 103s Unpacking debugedit (1:5.2-3) ... 103s Selecting previously unselected package dwz. 103s Preparing to unpack .../39-dwz_0.16-2_ppc64el.deb ... 103s Unpacking dwz (0.16-2) ... 104s Selecting previously unselected package gettext. 104s Preparing to unpack .../40-gettext_0.23.2-1_ppc64el.deb ... 104s Unpacking gettext (0.23.2-1) ... 104s Selecting previously unselected package intltool-debian. 104s Preparing to unpack .../41-intltool-debian_0.35.0+20060710.6_all.deb ... 104s Unpacking intltool-debian (0.35.0+20060710.6) ... 104s Selecting previously unselected package po-debconf. 104s Preparing to unpack .../42-po-debconf_1.0.21+nmu1_all.deb ... 104s Unpacking po-debconf (1.0.21+nmu1) ... 104s Selecting previously unselected package debhelper. 104s Preparing to unpack .../43-debhelper_13.24.2ubuntu1_all.deb ... 104s Unpacking debhelper (13.24.2ubuntu1) ... 104s Selecting previously unselected package dh-python. 104s Preparing to unpack .../44-dh-python_6.20250414_all.deb ... 104s Unpacking dh-python (6.20250414) ... 104s Selecting previously unselected package libpython3.14-stdlib:ppc64el. 104s Preparing to unpack .../45-libpython3.14-stdlib_3.14.0-4_ppc64el.deb ... 104s Unpacking libpython3.14-stdlib:ppc64el (3.14.0-4) ... 104s Selecting previously unselected package pybuild-plugin-autopkgtest. 104s Preparing to unpack .../46-pybuild-plugin-autopkgtest_6.20250414_all.deb ... 104s Unpacking pybuild-plugin-autopkgtest (6.20250414) ... 104s Selecting previously unselected package python3-pyproject-hooks. 104s Preparing to unpack .../47-python3-pyproject-hooks_1.2.0-1_all.deb ... 104s Unpacking python3-pyproject-hooks (1.2.0-1) ... 104s Selecting previously unselected package python3-wheel. 104s Preparing to unpack .../48-python3-wheel_0.46.1-2_all.deb ... 104s Unpacking python3-wheel (0.46.1-2) ... 104s Selecting previously unselected package python3-build. 104s Preparing to unpack .../49-python3-build_1.2.2-4_all.deb ... 104s Unpacking python3-build (1.2.2-4) ... 104s Selecting previously unselected package python3-installer. 104s Preparing to unpack .../50-python3-installer_0.7.0+dfsg1-3_all.deb ... 104s Unpacking python3-installer (0.7.0+dfsg1-3) ... 104s Selecting previously unselected package pybuild-plugin-pyproject. 104s Preparing to unpack .../51-pybuild-plugin-pyproject_6.20250414_all.deb ... 104s Unpacking pybuild-plugin-pyproject (6.20250414) ... 104s Selecting previously unselected package python3.14. 104s Preparing to unpack .../52-python3.14_3.14.0-4_ppc64el.deb ... 104s Unpacking python3.14 (3.14.0-4) ... 104s Selecting previously unselected package python3-all. 104s Preparing to unpack .../53-python3-all_3.13.7-2_ppc64el.deb ... 104s Unpacking python3-all (3.13.7-2) ... 104s Selecting previously unselected package python3-astroid. 104s Preparing to unpack .../54-python3-astroid_3.3.8-2_all.deb ... 104s Unpacking python3-astroid (3.3.8-2) ... 104s Selecting previously unselected package python3-iniconfig. 104s Preparing to unpack .../55-python3-iniconfig_2.1.0-1_all.deb ... 104s Unpacking python3-iniconfig (2.1.0-1) ... 104s Selecting previously unselected package python3-lazy-object-proxy. 104s Preparing to unpack .../56-python3-lazy-object-proxy_1.12.0-1_ppc64el.deb ... 104s Unpacking python3-lazy-object-proxy (1.12.0-1) ... 104s Selecting previously unselected package python3-pip. 104s Preparing to unpack .../57-python3-pip_25.1.1+dfsg-1ubuntu2_all.deb ... 104s Unpacking python3-pip (25.1.1+dfsg-1ubuntu2) ... 104s Selecting previously unselected package python3-pluggy. 104s Preparing to unpack .../58-python3-pluggy_1.6.0-1_all.deb ... 104s Unpacking python3-pluggy (1.6.0-1) ... 104s Selecting previously unselected package python3-pytest. 104s Preparing to unpack .../59-python3-pytest_8.3.5-2_all.deb ... 104s Unpacking python3-pytest (8.3.5-2) ... 104s Selecting previously unselected package python3-pytest-runner. 104s Preparing to unpack .../60-python3-pytest-runner_2.11.1-5_all.deb ... 104s Unpacking python3-pytest-runner (2.11.1-5) ... 104s Selecting previously unselected package python3-wrapt. 104s Preparing to unpack .../61-python3-wrapt_1.17.3-2_ppc64el.deb ... 104s Unpacking python3-wrapt (1.17.3-2) ... 104s Setting up dh-python (6.20250414) ... 104s Setting up python3-iniconfig (2.1.0-1) ... 105s Setting up libarchive-zip-perl (1.68-1) ... 105s Setting up libdebhelper-perl (13.24.2ubuntu1) ... 105s Setting up libpython3.14-minimal:ppc64el (3.14.0-4) ... 105s Setting up m4 (1.4.20-2) ... 105s Setting up libgomp1:ppc64el (15.2.0-7ubuntu1) ... 105s Setting up python3-wheel (0.46.1-2) ... 105s Setting up autotools-dev (20240727.1) ... 105s Setting up python3-pyproject-hooks (1.2.0-1) ... 105s Setting up libquadmath0:ppc64el (15.2.0-7ubuntu1) ... 105s Setting up libmpc3:ppc64el (1.3.1-2) ... 105s Setting up python3-wrapt (1.17.3-2) ... 105s Setting up autopoint (0.23.2-1) ... 105s Setting up python3-pip (25.1.1+dfsg-1ubuntu2) ... 108s Setting up python3-installer (0.7.0+dfsg1-3) ... 108s Setting up autoconf (2.72-3.1ubuntu1) ... 108s Setting up python3-pluggy (1.6.0-1) ... 108s Setting up libubsan1:ppc64el (15.2.0-7ubuntu1) ... 108s Setting up dwz (0.16-2) ... 108s Setting up python3-astroid (3.3.8-2) ... 109s Setting up libasan8:ppc64el (15.2.0-7ubuntu1) ... 109s Setting up debugedit (1:5.2-3) ... 109s Setting up python3-pytest-runner (2.11.1-5) ... 109s Setting up libtsan2:ppc64el (15.2.0-7ubuntu1) ... 109s Setting up python3-lazy-object-proxy (1.12.0-1) ... 109s Setting up libisl23:ppc64el (0.27-1) ... 109s Setting up python3-build (1.2.2-4) ... 109s Setting up python3.14-minimal (3.14.0-4) ... 110s Setting up libcc1-0:ppc64el (15.2.0-7ubuntu1) ... 110s Setting up liblsan0:ppc64el (15.2.0-7ubuntu1) ... 110s Setting up libitm1:ppc64el (15.2.0-7ubuntu1) ... 110s Setting up automake (1:1.18.1-2) ... 110s update-alternatives: using /usr/bin/automake-1.18 to provide /usr/bin/automake (automake) in auto mode 110s Setting up libfile-stripnondeterminism-perl (1.15.0-1) ... 110s Setting up gettext (0.23.2-1) ... 110s Setting up libgcc-15-dev:ppc64el (15.2.0-7ubuntu1) ... 110s Setting up libpython3.14-stdlib:ppc64el (3.14.0-4) ... 110s Setting up pybuild-plugin-pyproject (6.20250414) ... 110s Setting up python3-pytest (8.3.5-2) ... 111s Setting up intltool-debian (0.35.0+20060710.6) ... 111s Setting up cpp-15-powerpc64le-linux-gnu (15.2.0-7ubuntu1) ... 111s Setting up libstdc++-15-dev:ppc64el (15.2.0-7ubuntu1) ... 111s Setting up dh-strip-nondeterminism (1.15.0-1) ... 111s Setting up cpp-15 (15.2.0-7ubuntu1) ... 111s Setting up python3.14 (3.14.0-4) ... 112s Setting up cpp-powerpc64le-linux-gnu (4:15.2.0-4ubuntu1) ... 112s Setting up gcc-15-powerpc64le-linux-gnu (15.2.0-7ubuntu1) ... 112s Setting up po-debconf (1.0.21+nmu1) ... 112s Setting up python3-all (3.13.7-2) ... 112s Setting up gcc-15 (15.2.0-7ubuntu1) ... 112s Setting up gcc-powerpc64le-linux-gnu (4:15.2.0-4ubuntu1) ... 112s Setting up cpp (4:15.2.0-4ubuntu1) ... 112s Setting up g++-15-powerpc64le-linux-gnu (15.2.0-7ubuntu1) ... 112s Setting up libtool (2.5.4-7) ... 112s Setting up gcc (4:15.2.0-4ubuntu1) ... 112s Setting up dh-autoreconf (21) ... 112s Setting up g++-15 (15.2.0-7ubuntu1) ... 112s Setting up g++-powerpc64le-linux-gnu (4:15.2.0-4ubuntu1) ... 112s Setting up debhelper (13.24.2ubuntu1) ... 112s Setting up g++ (4:15.2.0-4ubuntu1) ... 112s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 112s Setting up build-essential (12.12ubuntu1) ... 112s Setting up pybuild-plugin-autopkgtest (6.20250414) ... 112s Processing triggers for man-db (2.13.1-1) ... 113s Processing triggers for install-info (7.2-5) ... 113s Processing triggers for libc-bin (2.42-2ubuntu2) ... 113s Processing triggers for systemd (257.9-0ubuntu2) ... 114s autopkgtest [13:03:06]: test pybuild-autopkgtest: pybuild-autopkgtest 114s autopkgtest [13:03:06]: test pybuild-autopkgtest: [----------------------- 115s pybuild-autopkgtest 115s I: pybuild base:311: cd /tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build; python3.14 -m pytest tests 119s ============================= test session starts ============================== 119s platform linux -- Python 3.14.0, pytest-8.3.5, pluggy-1.6.0 119s rootdir: /tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build 119s configfile: pyproject.toml 119s plugins: typeguard-4.4.2 119s collected 1708 items 119s 119s tests/brain/numpy/test_core_einsumfunc.py ss [ 0%] 119s tests/brain/numpy/test_core_fromnumeric.py s [ 0%] 119s tests/brain/numpy/test_core_function_base.py s [ 0%] 119s tests/brain/numpy/test_core_multiarray.py sssss [ 0%] 119s tests/brain/numpy/test_core_numeric.py sssss [ 0%] 119s tests/brain/numpy/test_core_numerictypes.py sssssss.. [ 1%] 119s tests/brain/numpy/test_core_umath.py ssssssss [ 1%] 119s tests/brain/numpy/test_ma.py ssss [ 2%] 119s tests/brain/numpy/test_ndarray.py sss [ 2%] 119s tests/brain/numpy/test_random_mtrand.py ss [ 2%] 119s tests/brain/test_argparse.py . [ 2%] 120s tests/brain/test_attr.py ....... [ 2%] 121s tests/brain/test_brain.py ......s.....ss......F......................... [ 5%] 121s ..........F.s.........................................................x. [ 9%] 122s ..............s...... [ 10%] 122s tests/brain/test_builtin.py .................. [ 12%] 122s tests/brain/test_ctypes.py ....x........................ [ 13%] 122s tests/brain/test_dataclasses.py ........................................ [ 16%] 122s ......................................x... [ 18%] 122s tests/brain/test_dateutil.py . [ 18%] 122s tests/brain/test_enum.py ............................. [ 20%] 122s tests/brain/test_hashlib.py ... [ 20%] 122s tests/brain/test_multiprocessing.py ... [ 20%] 123s tests/brain/test_named_tuple.py ....................... [ 21%] 123s tests/brain/test_nose.py s [ 22%] 123s tests/brain/test_pathlib.py FF.. [ 22%] 123s tests/brain/test_pytest.py . [ 22%] 123s tests/brain/test_qt.py sss [ 22%] 123s tests/brain/test_regex.py ss [ 22%] 123s tests/brain/test_signal.py ... [ 22%] 125s tests/brain/test_six.py ....... [ 23%] 125s tests/brain/test_ssl.py .. [ 23%] 125s tests/brain/test_threading.py .... [ 23%] 125s tests/brain/test_typing.py ..... [ 23%] 125s tests/brain/test_typing_extensions.py . [ 23%] 125s tests/brain/test_unittest.py . [ 23%] 127s tests/test_builder.py ...........................................FFFFFFF [ 26%] 127s FFFF.... [ 27%] 127s tests/test_constraint.py ................................... [ 29%] 127s tests/test_decorators.py ... [ 29%] 127s tests/test_filter_statements.py . [ 29%] 127s tests/test_group_exceptions.py ... [ 29%] 127s tests/test_helpers.py ............... [ 30%] 128s tests/test_inference.py ............................................F... [ 33%] 128s ............................................x...........x......x........ [ 37%] 129s ..................................................x..................... [ 41%] 129s ........................................................................ [ 46%] 130s ................................................x........xx............. [ 50%] 130s ........x...x................................................x.......... [ 54%] 130s ................................. [ 56%] 130s tests/test_inference_calls.py ........................ [ 57%] 132s tests/test_lookup.py FFFFFFFFFFFFFFFFFFFFFFFFFFFF....................... [ 60%] 132s .... [ 61%] 148s tests/test_manager.py .....................................s....... [ 63%] 149s tests/test_modutils.py ................................................. [ 66%] 149s ................s. [ 67%] 150s tests/test_nodes.py ............F................FFFFFFFFF.............. [ 70%] 150s ........................................................................ [ 74%] 150s ................................................................ [ 78%] 150s tests/test_nodes_lineno.py ....................... [ 80%] 150s tests/test_nodes_position.py ... [ 80%] 151s tests/test_object_model.py x...............x.........s........... [ 82%] 151s tests/test_objects.py ...................... [ 83%] 151s tests/test_protocols.py ..................... [ 84%] 151s tests/test_python3.py .......................... [ 86%] 151s tests/test_raw_building.py ............. [ 87%] 158s tests/test_regrtest.py .............ss............ [ 88%] 161s tests/test_scoped_nodes.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 91%] 167s FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 95%] 169s FFFFFFFFFFFFFFFF.................................. [ 98%] 169s tests/test_stdlib.py .. [ 98%] 169s tests/test_transforms.py ......... [ 99%] 169s tests/test_type_params.py ..... [ 99%] 169s tests/test_utils.py ........ [100%] 169s 169s =================================== FAILURES =================================== 169s _______________________ TypingBrain.test_has_dunder_args _______________________ 169s 169s self = 169s 169s def test_has_dunder_args(self) -> None: 169s ast_node = builder.extract_node( 169s """ 169s from typing import Union 169s NumericTypes = Union[int, float] 169s NumericTypes.__args__ #@ 169s """ 169s ) 169s inferred = next(ast_node.infer()) 169s > assert isinstance(inferred, nodes.Tuple) 169s E AssertionError: assert False 169s E + where False = isinstance(Uninferable, ) 169s E + where = nodes.Tuple 169s 169s tests/brain/test_brain.py:747: AssertionError 169s ________________________ TypingBrain.test_typing_types _________________________ 169s 169s self = 169s 169s def test_typing_types(self) -> None: 169s ast_nodes = builder.extract_node( 169s """ 169s from typing import TypeVar, Iterable, Tuple, NewType, Dict, Union 169s TypeVar('MyTypeVar', int, float, complex) #@ 169s Iterable[Tuple[MyTypeVar, MyTypeVar]] #@ 169s TypeVar('AnyStr', str, bytes) #@ 169s NewType('UserId', str) #@ 169s Dict[str, str] #@ 169s Union[int, str] #@ 169s """ 169s ) 169s for node in ast_nodes: 169s inferred = next(node.infer()) 169s > self.assertIsInstance(inferred, nodes.ClassDef, node.as_string()) 169s E AssertionError: Uninferable is not an instance of : Union[int, str] 169s 169s tests/brain/test_brain.py:561: AssertionError 169s ____________________________ test_inference_parents ____________________________ 169s 169s def test_inference_parents() -> None: 169s """Test inference of ``pathlib.Path.parents``.""" 169s name_node = astroid.extract_node( 169s """ 169s from pathlib import Path 169s 169s current_path = Path().resolve() 169s path_parents = current_path.parents 169s path_parents 169s """ 169s ) 169s inferred = name_node.inferred() 169s assert len(inferred) == 1 169s assert isinstance(inferred[0], bases.Instance) 169s if PY313_PLUS: 169s > assert inferred[0].qname() == "builtins.tuple" 169s E AssertionError: assert 'pathlib._PathParents' == 'builtins.tuple' 169s E 169s E - builtins.tuple 169s E + pathlib._PathParents 169s 169s tests/brain/test_pathlib.py:27: AssertionError 169s ____________________ test_inference_parents_subscript_index ____________________ 169s 169s def test_inference_parents_subscript_index() -> None: 169s """Test inference of ``pathlib.Path.parents``, accessed by index.""" 169s path = astroid.extract_node( 169s """ 169s from pathlib import Path 169s 169s current_path = Path().resolve() 169s current_path.parents[2] #@ 169s """ 169s ) 169s 169s inferred = path.inferred() 169s assert len(inferred) == 1 169s assert isinstance(inferred[0], bases.Instance) 169s if PY313_PLUS: 169s > assert inferred[0].qname() == "pathlib._local.Path" 169s E AssertionError: assert 'builtins.tuple' == 'pathlib._local.Path' 169s E 169s E - pathlib._local.Path 169s E + builtins.tuple 169s 169s tests/brain/test_pathlib.py:47: AssertionError 169s _____________________ FileBuildTest.test_class_base_props ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ FileBuildTest.test_class_basenames ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ FileBuildTest.test_class_instance_attrs ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ FileBuildTest.test_class_locals ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ FileBuildTest.test_function_base_props ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ FileBuildTest.test_function_locals ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FileBuildTest.test_method_base_props _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ FileBuildTest.test_method_locals _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FileBuildTest.test_module_base_props _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ FileBuildTest.test_module_locals _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FileBuildTest.test_unknown_encoding ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_builder.py:752: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ InferenceTest.test_binary_op_or_union_type __________________ 169s 169s self = 169s 169s def test_binary_op_or_union_type(self) -> None: 169s """Binary or union is only defined for Python 3.10+.""" 169s code = """ 169s class A: ... 169s 169s int | 2 #@ 169s int | "Hello" #@ 169s int | ... #@ 169s int | A() #@ 169s int | None | 2 #@ 169s """ 169s ast_nodes = extract_node(code) 169s for n in ast_nodes: 169s assert n.inferred() == [util.Uninferable] 169s 169s code = """ 169s from typing import List 169s 169s class A: ... 169s class B: ... 169s 169s int | None #@ 169s int | str #@ 169s int | str | None #@ 169s A | B #@ 169s A | None #@ 169s List[int] | int #@ 169s tuple | int #@ 169s """ 169s ast_nodes = extract_node(code) 169s if not PY310_PLUS: 169s for n in ast_nodes: 169s assert n.inferred() == [util.Uninferable] 169s else: 169s i0 = ast_nodes[0].inferred()[0] 169s assert isinstance(i0, UnionType) 169s assert isinstance(i0.left, nodes.ClassDef) 169s assert i0.left.name == "int" 169s assert isinstance(i0.right, nodes.Const) 169s assert i0.right.value is None 169s 169s # Assert basic UnionType properties and methods 169s assert i0.callable() is False 169s assert i0.bool_value() is True 169s assert i0.pytype() == "types.UnionType" 169s assert i0.display_type() == "UnionType" 169s > assert str(i0) == "UnionType(UnionType)" 169s E AssertionError: assert 'UnionType(Union)' == 'UnionType(UnionType)' 169s E 169s E - UnionType(UnionType) 169s E ? ---- 169s E + UnionType(Union) 169s 169s tests/test_inference.py:1309: AssertionError 169s ________________________ LookupTest.test_builtin_lookup ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________________ LookupTest.test_class _____________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ LookupTest.test_class_ancestor_name ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ LookupTest.test_class_in_function _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ LookupTest.test_class_variables ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ LookupTest.test_decorator_arguments_lookup __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ LookupTest.test_dict_comp_nested _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________________ LookupTest.test_dict_comps __________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ LookupTest.test_explicit___name__ _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________ LookupTest.test_function_argument_with_default ________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ LookupTest.test_function_module_special ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ LookupTest.test_function_nested ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ LookupTest.test_generator_attributes _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ LookupTest.test_global_delete _________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ LookupTest.test_inner_classes _________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________ LookupTest.test_inner_decorator_member_lookup _________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ LookupTest.test_lambda_nested _________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________________ LookupTest.test_limit _____________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ LookupTest.test_list_comp_nested _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ LookupTest.test_list_comp_target _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________________ LookupTest.test_list_comps __________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ LookupTest.test_loopvar_hiding ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________________ LookupTest.test_method ____________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________________ LookupTest.test_module ____________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ LookupTest.test_set_comp_closure _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ LookupTest.test_set_comp_nested ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________________ LookupTest.test_set_comps ___________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ LookupTest.test_static_method_lookup _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_lookup.py:22: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ AsStringTest.test_module_as_string ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def test_module_as_string(self) -> None: 169s """Check as_string on a whole module prepared to be returned identically.""" 169s > module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:114: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ ImportNodeTest.test_absolute_import ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ ImportNodeTest.test_as_string _________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ ImportNodeTest.test_bad_import_inference ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ ImportNodeTest.test_conditional ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ ImportNodeTest.test_conditional_import ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ ImportNodeTest.test_from_self_resolve _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ ImportNodeTest.test_import_self_resolve ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ ImportNodeTest.test_more_absolute_import ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ ImportNodeTest.test_real_name _________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_nodes.py:481: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________ ModuleNodeTest.test_comment_before_docstring _________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ ModuleNodeTest.test_dict_interface ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ ModuleNodeTest.test_file_stream_api ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ ModuleNodeTest.test_file_stream_in_memory ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ ModuleNodeTest.test_file_stream_physical ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________________ ModuleNodeTest.test_getattr __________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________________ ModuleNodeTest.test_import_1 _________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________________ ModuleNodeTest.test_import_2 _________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________ ModuleNodeTest.test_import_unavailable_module _________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ ModuleNodeTest.test_module_getattr ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ ModuleNodeTest.test_multiline_docstring ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ ModuleNodeTest.test_public_names _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________ ModuleNodeTest.test_relative_to_absolute_name _________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________ ModuleNodeTest.test_relative_to_absolute_name_beyond_top_level ________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ ModuleNodeTest.test_singleline_docstring ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ ModuleNodeTest.test_special_attributes ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ ModuleNodeTest.test_stream_api ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ ModuleNodeTest.test_wildcard_import_names ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ ModuleNodeTest.test_without_docstring _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________ FunctionNodeTest.test_abstract_methods_are_not_implicitly_none ________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ FunctionNodeTest.test_argnames ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ FunctionNodeTest.test_argnames_lambda _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________ FunctionNodeTest.test_decorator_builtin_descriptors ______________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FunctionNodeTest.test_default_value ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FunctionNodeTest.test_dict_interface _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ FunctionNodeTest.test_display_type ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________ FunctionNodeTest.test_docstring_special_cases _________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________ FunctionNodeTest.test_dunder_class_local_to_classmethod ____________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________ FunctionNodeTest.test_dunder_class_local_to_function _____________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________ FunctionNodeTest.test_dunder_class_local_to_method ______________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ FunctionNodeTest.test_format_args _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________ FunctionNodeTest.test_format_args_keyword_only_args ______________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ FunctionNodeTest.test_four_args ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ FunctionNodeTest.test_func_instance_attr ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FunctionNodeTest.test_func_is_bound ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________________ FunctionNodeTest.test_igetattr ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ FunctionNodeTest.test_inference_error _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ FunctionNodeTest.test_is_abstract _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________ FunctionNodeTest.test_is_abstract_decorated __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ FunctionNodeTest.test_is_generator ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ FunctionNodeTest.test_is_method ________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FunctionNodeTest.test_lambda_getattr _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FunctionNodeTest.test_lambda_pytype ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ FunctionNodeTest.test_lambda_qname ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ FunctionNodeTest.test_method_init_subclass __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ FunctionNodeTest.test_multiline_docstring ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________ FunctionNodeTest.test_multiline_docstring_async ________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ FunctionNodeTest.test_navigation _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________ FunctionNodeTest.test_no_returns_is_implicitly_none ______________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________ FunctionNodeTest.test_only_raises_is_not_implicitly_none ___________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________ FunctionNodeTest.test_positional_only_argnames ________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________ FunctionNodeTest.test_return_annotation_is_not_the_last ____________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ FunctionNodeTest.test_return_nothing _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ FunctionNodeTest.test_singleline_docstring __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ FunctionNodeTest.test_special_attributes ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________ FunctionNodeTest.test_type_builtin_descriptor_subclasses ___________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ FunctionNodeTest.test_without_docstring ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ ClassNodeTest.test__bases__attribute _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ ClassNodeTest.test__mro__attribute ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ ClassNodeTest.test_add_metaclass _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________ ClassNodeTest.test_all_ancestors_need_slots __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________________ ClassNodeTest.test_ancestors _________________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ ClassNodeTest.test_class_extra_decorators ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________ ClassNodeTest.test_class_extra_decorators_frame_is_not_class _________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _ ClassNodeTest.test_class_extra_decorators_only_assignment_names_are_considered _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____ ClassNodeTest.test_class_extra_decorators_only_callfunc_are_considered ____ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____ ClassNodeTest.test_class_extra_decorators_only_same_name_considered ______ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ ClassNodeTest.test_class_getattr _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ ClassNodeTest.test_class_keywords _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ ClassNodeTest.test_classmethod_attributes ___________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________ ClassNodeTest.test_cls_special_attributes_1 __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________ ClassNodeTest.test_cls_special_attributes_2 __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________________ ClassNodeTest.test_dict_interface _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ________________ ClassNodeTest.test_duplicate_bases_namedtuple _________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______ ClassNodeTest.test_extra_decorators_only_class_level_assignments _______ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________ ClassNodeTest.test_function_with_decorator_lineno _______________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________ ClassNodeTest.test_generator_from_infer_call_result_parent __________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ___________________ ClassNodeTest.test_getattr_from_grandpa ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________ ClassNodeTest.test_getattr_method_transform __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________ ClassNodeTest.test_getattr_with_enpty_annassign ________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ ClassNodeTest.test_has_dynamic_getattr ____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ____________________ ClassNodeTest.test_implicit_metaclass _____________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _________________ ClassNodeTest.test_implicit_metaclass_lookup _________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________________ ClassNodeTest.test_inner_classes _______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s __________________ ClassNodeTest.test_instance_attr_ancestors __________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _______________ ClassNodeTest.test_instance_bound_method_lambdas _______________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s ______________ ClassNodeTest.test_instance_bound_method_lambdas_2 ______________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________________ ClassNodeTest.test_instance_getattr ______________________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 169s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 169s E 'return' in a 'finally' block (data.module, line 62) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 169s _____________ ClassNodeTest.test_instance_getattr_with_class_attr ______________ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s > node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s 169s /usr/lib/python3/dist-packages/astroid/builder.py:181: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 169s parsed = parser_module.parse( 169s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 169s return ast.parse(string, filename=filename, type_comments=type_comments) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 169s filename = 'data.module', mode = 'exec' 169s 169s def parse(source, filename='', mode='exec', *, 169s type_comments=False, feature_version=None, optimize=-1): 169s """ 169s Parse the source into an AST node. 169s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 169s Pass type_comments=True to get back type comments where the syntax allows. 169s """ 169s flags = PyCF_ONLY_AST 169s if optimize > 0: 169s flags |= PyCF_OPTIMIZED_AST 169s if type_comments: 169s flags |= PyCF_TYPE_COMMENTS 169s if feature_version is None: 169s feature_version = -1 169s elif isinstance(feature_version, tuple): 169s major, minor = feature_version # Should be a 2-tuple. 169s if major != 3: 169s raise ValueError(f"Unsupported major version: {major}") 169s feature_version = minor 169s # Else it should be an int giving the minor version for 3.x. 169s > return compile(source, filename, mode, flags, 169s _feature_version=feature_version, optimize=optimize) 169s E File "data.module", line 62 169s E SyntaxError: 'return' in a 'finally' block 169s 169s /usr/lib/python3.14/ast.py:46: SyntaxError 169s 169s The above exception was the direct cause of the following exception: 169s 169s self = 169s 169s def setUp(self) -> None: 169s super().setUp() 169s > self.module = resources.build_file("data/module.py", "data.module") 169s 169s tests/test_scoped_nodes.py:73: 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s tests/resources.py:23: in build_file 169s return builder.AstroidBuilder().file_build(find(path), modname) 169s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 169s module, builder = self._data_build(data, modname, path) 169s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 169s 169s self = 169s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 169s modname = 'data.module' 169s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 169s 169s def _data_build( 169s self, data: str, modname: str, path: str | None 169s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 169s """Build tree node from data and add some informations.""" 169s try: 169s node, parser_module = _parse_string( 169s data, type_comments=True, modname=modname 169s ) 169s except (TypeError, ValueError, SyntaxError) as exc: 169s > raise AstroidSyntaxError( 169s "Parsing Python code failed:\n{error}", 169s source=data, 169s modname=modname, 169s path=path, 169s error=exc, 169s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ________________ ClassNodeTest.test_instance_special_attributes ________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ________________________ ClassNodeTest.test_kite_graph _________________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ___________________ ClassNodeTest.test_local_attr_ancestors ____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s __________________ ClassNodeTest.test_local_attr_invalid_mro ___________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ______________________ ClassNodeTest.test_local_attr_mro _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ______________________ ClassNodeTest.test_metaclass_error ______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _________________ ClassNodeTest.test_metaclass_generator_hack __________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________ ClassNodeTest.test_metaclass_generator_hack_enum_base _____________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _____________________ ClassNodeTest.test_metaclass_lookup ______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _____________ ClassNodeTest.test_metaclass_lookup_inference_errors _____________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _____________ ClassNodeTest.test_metaclass_lookup_using_same_class _____________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ______________________ ClassNodeTest.test_metaclass_type _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________________ ClassNodeTest.test_metaclass_yes_leak _____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s __________________________ ClassNodeTest.test_methods __________________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________________________ ClassNodeTest.test_mro ____________________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _______________________ ClassNodeTest.test_mro_generic_1 _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _______________________ ClassNodeTest.test_mro_generic_2 _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _______________________ ClassNodeTest.test_mro_generic_3 _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _______________________ ClassNodeTest.test_mro_generic_4 _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _______________________ ClassNodeTest.test_mro_generic_5 _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _______________________ ClassNodeTest.test_mro_generic_6 _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _______________________ ClassNodeTest.test_mro_generic_7 _______________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________________ ClassNodeTest.test_mro_generic_error_1 ____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________________ ClassNodeTest.test_mro_generic_error_2 ____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ___________________ ClassNodeTest.test_mro_typing_extensions ___________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ________________ ClassNodeTest.test_mro_with_attribute_classes _________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________________ ClassNodeTest.test_mro_with_factories _____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________________ ClassNodeTest.test_multiline_docstring ____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ________________________ ClassNodeTest.test_navigation _________________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ________________ ClassNodeTest.test_no_infinite_metaclass_loop _________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _________ ClassNodeTest.test_no_infinite_metaclass_loop_with_redefine __________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _________________ ClassNodeTest.test_nonregr_infer_callresult __________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ___________________ ClassNodeTest.test_singleline_docstring ____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ___________________________ ClassNodeTest.test_slots ___________________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s __________ ClassNodeTest.test_slots_added_dynamically_still_inferred ___________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _________________ ClassNodeTest.test_slots_empty_list_of_slots _________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________________ ClassNodeTest.test_slots_for_dict_keys ____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _________________ ClassNodeTest.test_slots_taken_from_parents __________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ___________________________ ClassNodeTest.test_type ____________________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ___________________ ClassNodeTest.test_type_three_arguments ____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ___________ ClassNodeTest.test_using_invalid_six_add_metaclass_call ____________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s __________________ ClassNodeTest.test_with_invalid_metaclass ___________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s ____________________ ClassNodeTest.test_with_metaclass_mro _____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s _____________________ ClassNodeTest.test_without_docstring _____________________ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s > node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:181: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s /usr/lib/python3/dist-packages/astroid/builder.py:477: in _parse_string 170s parsed = parser_module.parse( 170s /usr/lib/python3/dist-packages/astroid/_ast.py:29: in parse 170s return ast.parse(string, filename=filename, type_comments=type_comments) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s source = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n\n' 170s filename = 'data.module', mode = 'exec' 170s 170s def parse(source, filename='', mode='exec', *, 170s type_comments=False, feature_version=None, optimize=-1): 170s """ 170s Parse the source into an AST node. 170s Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). 170s Pass type_comments=True to get back type comments where the syntax allows. 170s """ 170s flags = PyCF_ONLY_AST 170s if optimize > 0: 170s flags |= PyCF_OPTIMIZED_AST 170s if type_comments: 170s flags |= PyCF_TYPE_COMMENTS 170s if feature_version is None: 170s feature_version = -1 170s elif isinstance(feature_version, tuple): 170s major, minor = feature_version # Should be a 2-tuple. 170s if major != 3: 170s raise ValueError(f"Unsupported major version: {major}") 170s feature_version = minor 170s # Else it should be an int giving the minor version for 3.x. 170s > return compile(source, filename, mode, flags, 170s _feature_version=feature_version, optimize=optimize) 170s E File "data.module", line 62 170s E SyntaxError: 'return' in a 'finally' block 170s 170s /usr/lib/python3.14/ast.py:46: SyntaxError 170s 170s The above exception was the direct cause of the following exception: 170s 170s self = 170s 170s def setUp(self) -> None: 170s super().setUp() 170s > self.module = resources.build_file("data/module.py", "data.module") 170s 170s tests/test_scoped_nodes.py:73: 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s tests/resources.py:23: in build_file 170s return builder.AstroidBuilder().file_build(find(path), modname) 170s /usr/lib/python3/dist-packages/astroid/builder.py:144: in file_build 170s module, builder = self._data_build(data, modname, path) 170s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 170s 170s self = 170s data = '"""test module for astroid\n"""\n\n__revision__ = \'$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $\'\nfrom astroi...= a and (b or c)\n else:\n c = a and b or d\n list(map(lambda x, y: (y, x), a))\nredirect = four_args\n\n' 170s modname = 'data.module' 170s path = '/tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build/tests/testdata/python3/data/module.py' 170s 170s def _data_build( 170s self, data: str, modname: str, path: str | None 170s ) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: 170s """Build tree node from data and add some informations.""" 170s try: 170s node, parser_module = _parse_string( 170s data, type_comments=True, modname=modname 170s ) 170s except (TypeError, ValueError, SyntaxError) as exc: 170s > raise AstroidSyntaxError( 170s "Parsing Python code failed:\n{error}", 170s source=data, 170s modname=modname, 170s path=path, 170s error=exc, 170s ) from exc 170s E astroid.exceptions.AstroidSyntaxError: Parsing Python code failed: 170s E 'return' in a 'finally' block (data.module, line 62) 170s 170s /usr/lib/python3/dist-packages/astroid/builder.py:185: AstroidSyntaxError 170s =========================== short test summary info ============================ 170s FAILED tests/brain/test_brain.py::TypingBrain::test_has_dunder_args - Asserti... 170s FAILED tests/brain/test_brain.py::TypingBrain::test_typing_types - AssertionE... 170s FAILED tests/brain/test_pathlib.py::test_inference_parents - AssertionError: ... 170s FAILED tests/brain/test_pathlib.py::test_inference_parents_subscript_index - ... 170s FAILED tests/test_builder.py::FileBuildTest::test_class_base_props - astroid.... 170s FAILED tests/test_builder.py::FileBuildTest::test_class_basenames - astroid.e... 170s FAILED tests/test_builder.py::FileBuildTest::test_class_instance_attrs - astr... 170s FAILED tests/test_builder.py::FileBuildTest::test_class_locals - astroid.exce... 170s FAILED tests/test_builder.py::FileBuildTest::test_function_base_props - astro... 170s FAILED tests/test_builder.py::FileBuildTest::test_function_locals - astroid.e... 170s FAILED tests/test_builder.py::FileBuildTest::test_method_base_props - astroid... 170s FAILED tests/test_builder.py::FileBuildTest::test_method_locals - astroid.exc... 170s FAILED tests/test_builder.py::FileBuildTest::test_module_base_props - astroid... 170s FAILED tests/test_builder.py::FileBuildTest::test_module_locals - astroid.exc... 170s FAILED tests/test_builder.py::FileBuildTest::test_unknown_encoding - astroid.... 170s FAILED tests/test_inference.py::InferenceTest::test_binary_op_or_union_type 170s FAILED tests/test_lookup.py::LookupTest::test_builtin_lookup - astroid.except... 170s FAILED tests/test_lookup.py::LookupTest::test_class - astroid.exceptions.Astr... 170s FAILED tests/test_lookup.py::LookupTest::test_class_ancestor_name - astroid.e... 170s FAILED tests/test_lookup.py::LookupTest::test_class_in_function - astroid.exc... 170s FAILED tests/test_lookup.py::LookupTest::test_class_variables - astroid.excep... 170s FAILED tests/test_lookup.py::LookupTest::test_decorator_arguments_lookup - as... 170s FAILED tests/test_lookup.py::LookupTest::test_dict_comp_nested - astroid.exce... 170s FAILED tests/test_lookup.py::LookupTest::test_dict_comps - astroid.exceptions... 170s FAILED tests/test_lookup.py::LookupTest::test_explicit___name__ - astroid.exc... 170s FAILED tests/test_lookup.py::LookupTest::test_function_argument_with_default 170s FAILED tests/test_lookup.py::LookupTest::test_function_module_special - astro... 170s FAILED tests/test_lookup.py::LookupTest::test_function_nested - astroid.excep... 170s FAILED tests/test_lookup.py::LookupTest::test_generator_attributes - astroid.... 170s FAILED tests/test_lookup.py::LookupTest::test_global_delete - astroid.excepti... 170s FAILED tests/test_lookup.py::LookupTest::test_inner_classes - astroid.excepti... 170s FAILED tests/test_lookup.py::LookupTest::test_inner_decorator_member_lookup 170s FAILED tests/test_lookup.py::LookupTest::test_lambda_nested - astroid.excepti... 170s FAILED tests/test_lookup.py::LookupTest::test_limit - astroid.exceptions.Astr... 170s FAILED tests/test_lookup.py::LookupTest::test_list_comp_nested - astroid.exce... 170s FAILED tests/test_lookup.py::LookupTest::test_list_comp_target - astroid.exce... 170s FAILED tests/test_lookup.py::LookupTest::test_list_comps - astroid.exceptions... 170s FAILED tests/test_lookup.py::LookupTest::test_loopvar_hiding - astroid.except... 170s FAILED tests/test_lookup.py::LookupTest::test_method - astroid.exceptions.Ast... 170s FAILED tests/test_lookup.py::LookupTest::test_module - astroid.exceptions.Ast... 170s FAILED tests/test_lookup.py::LookupTest::test_set_comp_closure - astroid.exce... 170s FAILED tests/test_lookup.py::LookupTest::test_set_comp_nested - astroid.excep... 170s FAILED tests/test_lookup.py::LookupTest::test_set_comps - astroid.exceptions.... 170s FAILED tests/test_lookup.py::LookupTest::test_static_method_lookup - astroid.... 170s FAILED tests/test_nodes.py::AsStringTest::test_module_as_string - astroid.exc... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_absolute_import - astroid.ex... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_as_string - astroid.exceptio... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_bad_import_inference - astro... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_conditional - astroid.except... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_conditional_import - astroid... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_from_self_resolve - astroid.... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_import_self_resolve - astroi... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_more_absolute_import - astro... 170s FAILED tests/test_nodes.py::ImportNodeTest::test_real_name - astroid.exceptio... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_comment_before_docstring 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_dict_interface - astr... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_api - ast... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_in_memory 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_file_stream_physical 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_getattr - astroid.exc... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_1 - astroid.ex... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_2 - astroid.ex... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_import_unavailable_module 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_module_getattr - astr... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_multiline_docstring 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_public_names - astroi... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_relative_to_absolute_name 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_relative_to_absolute_name_beyond_top_level 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_singleline_docstring 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_special_attributes - ... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_stream_api - astroid.... 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_wildcard_import_names 170s FAILED tests/test_scoped_nodes.py::ModuleNodeTest::test_without_docstring - a... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_abstract_methods_are_not_implicitly_none 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_argnames - astroid.... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_argnames_lambda - a... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_decorator_builtin_descriptors 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_default_value - ast... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dict_interface - as... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_display_type - astr... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_docstring_special_cases 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_classmethod 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_function 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_dunder_class_local_to_method 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_format_args - astro... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_format_args_keyword_only_args 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_four_args - astroid... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_func_instance_attr 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_func_is_bound - ast... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_igetattr - astroid.... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_inference_error - a... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_abstract - astro... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_abstract_decorated 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_generator - astr... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_is_method - astroid... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_getattr - as... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_pytype - ast... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_lambda_qname - astr... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_method_init_subclass 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_multiline_docstring 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_multiline_docstring_async 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_navigation - astroi... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_no_returns_is_implicitly_none 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_only_raises_is_not_implicitly_none 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_positional_only_argnames 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_return_annotation_is_not_the_last 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_return_nothing - as... 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_singleline_docstring 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_special_attributes 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_type_builtin_descriptor_subclasses 170s FAILED tests/test_scoped_nodes.py::FunctionNodeTest::test_without_docstring 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test__bases__attribute - as... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test__mro__attribute - astr... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_add_metaclass - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_all_ancestors_need_slots 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_ancestors - astroid.ex... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_frame_is_not_class 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_assignment_names_are_considered 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_callfunc_are_considered 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_extra_decorators_only_same_name_considered 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_getattr - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_class_keywords - astro... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_classmethod_attributes 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_cls_special_attributes_1 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_cls_special_attributes_2 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_dict_interface - astro... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_duplicate_bases_namedtuple 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_extra_decorators_only_class_level_assignments 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_function_with_decorator_lineno 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_generator_from_infer_call_result_parent 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_from_grandpa 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_method_transform 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_getattr_with_enpty_annassign 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_has_dynamic_getattr - ... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_implicit_metaclass - a... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_implicit_metaclass_lookup 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_inner_classes - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_attr_ancestors 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_bound_method_lambdas 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_bound_method_lambdas_2 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_getattr - ast... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_getattr_with_class_attr 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_instance_special_attributes 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_kite_graph - astroid.e... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_ancestors 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_invalid_mro 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_local_attr_mro - astro... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_error - astr... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_generator_hack 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_generator_hack_enum_base 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup - ast... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup_inference_errors 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_lookup_using_same_class 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_type - astro... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_metaclass_yes_leak - a... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_methods - astroid.exce... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro - astroid.exceptio... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_1 - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_2 - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_3 - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_4 - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_5 - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_6 - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_7 - astroi... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_error_1 - ... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_generic_error_2 - ... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_typing_extensions 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_with_attribute_classes 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_mro_with_factories - a... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_multiline_docstring - ... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_navigation - astroid.e... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_no_infinite_metaclass_loop 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_no_infinite_metaclass_loop_with_redefine 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_nonregr_infer_callresult 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_singleline_docstring 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots - astroid.except... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_added_dynamically_still_inferred 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_empty_list_of_slots 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_for_dict_keys - ... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_slots_taken_from_parents 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_type - astroid.excepti... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_type_three_arguments 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_using_invalid_six_add_metaclass_call 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_with_invalid_metaclass 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_with_metaclass_mro - a... 170s FAILED tests/test_scoped_nodes.py::ClassNodeTest::test_without_docstring - as... 170s ========== 187 failed, 1452 passed, 54 skipped, 15 xfailed in 53.49s =========== 170s E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build; python3.14 -m pytest tests 170s I: pybuild base:311: cd /tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build; python3.13 -m pytest tests 173s ============================= test session starts ============================== 173s platform linux -- Python 3.13.9, pytest-8.3.5, pluggy-1.6.0 173s rootdir: /tmp/autopkgtest.hiVwg2/autopkgtest_tmp/build 173s configfile: pyproject.toml 173s plugins: typeguard-4.4.2 173s collected 1708 items 173s 173s tests/brain/numpy/test_core_einsumfunc.py ss [ 0%] 173s tests/brain/numpy/test_core_fromnumeric.py s [ 0%] 173s tests/brain/numpy/test_core_function_base.py s [ 0%] 173s tests/brain/numpy/test_core_multiarray.py sssss [ 0%] 173s tests/brain/numpy/test_core_numeric.py sssss [ 0%] 173s tests/brain/numpy/test_core_numerictypes.py sssssss.. [ 1%] 173s tests/brain/numpy/test_core_umath.py ssssssss [ 1%] 173s tests/brain/numpy/test_ma.py ssss [ 2%] 173s tests/brain/numpy/test_ndarray.py sss [ 2%] 173s tests/brain/numpy/test_random_mtrand.py ss [ 2%] 173s tests/brain/test_argparse.py . [ 2%] 174s tests/brain/test_attr.py ....... [ 2%] 175s tests/brain/test_brain.py ......s.....ss................................ [ 5%] 176s ............s.........................................................x. [ 9%] 176s ..............s...... [ 10%] 176s tests/brain/test_builtin.py .................. [ 12%] 176s tests/brain/test_ctypes.py ....x........................ [ 13%] 177s tests/brain/test_dataclasses.py ........................................ [ 16%] 177s ......................................x... [ 18%] 177s tests/brain/test_dateutil.py . [ 18%] 177s tests/brain/test_enum.py ............................. [ 20%] 177s tests/brain/test_hashlib.py ... [ 20%] 177s tests/brain/test_multiprocessing.py ... [ 20%] 177s tests/brain/test_named_tuple.py ....................... [ 21%] 178s tests/brain/test_nose.py s [ 22%] 178s tests/brain/test_pathlib.py .... [ 22%] 178s tests/brain/test_pytest.py . [ 22%] 178s tests/brain/test_qt.py sss [ 22%] 178s tests/brain/test_regex.py ss [ 22%] 178s tests/brain/test_signal.py ... [ 22%] 180s tests/brain/test_six.py ....... [ 23%] 180s tests/brain/test_ssl.py .. [ 23%] 180s tests/brain/test_threading.py .... [ 23%] 180s tests/brain/test_typing.py ..... [ 23%] 181s tests/brain/test_typing_extensions.py . [ 23%] 181s tests/brain/test_unittest.py . [ 23%] 183s tests/test_builder.py .................................................. [ 26%] 183s ........ [ 27%] 183s tests/test_constraint.py ................................... [ 29%] 183s tests/test_decorators.py ... [ 29%] 183s tests/test_filter_statements.py . [ 29%] 183s tests/test_group_exceptions.py ... [ 29%] 183s tests/test_helpers.py ............... [ 30%] 183s tests/test_inference.py ................................................ [ 33%] 184s ............................................x...........x......x........ [ 37%] 184s ..................................................x..................... [ 41%] 184s ........................................................................ [ 46%] 185s ................................................x........xx............. [ 50%] 185s ........x...x................................................x.......... [ 54%] 185s ................................. [ 56%] 185s tests/test_inference_calls.py ........................ [ 57%] 186s tests/test_lookup.py ................................................... [ 60%] 186s .... [ 61%] 201s tests/test_manager.py .....................................s....... [ 63%] 202s tests/test_modutils.py ................................................. [ 66%] 202s ................s. [ 67%] 204s tests/test_nodes.py .................................................... [ 70%] 204s ........................................................................ [ 74%] 204s ................................................................ [ 78%] 204s tests/test_nodes_lineno.py ....................... [ 80%] 204s tests/test_nodes_position.py ... [ 80%] 204s tests/test_object_model.py x...............x.........s........... [ 82%] 204s tests/test_objects.py ...................... [ 83%] 204s tests/test_protocols.py ..................... [ 84%] 204s tests/test_python3.py .......................... [ 86%] 205s tests/test_raw_building.py ............. [ 87%] 211s tests/test_regrtest.py .............ss............ [ 88%] 212s tests/test_scoped_nodes.py ............................................. [ 91%] 214s ........................................................................ [ 95%] 214s .................................................. [ 98%] 214s tests/test_stdlib.py .. [ 98%] 214s tests/test_transforms.py ......... [ 99%] 214s tests/test_type_params.py ..... [ 99%] 215s tests/test_utils.py ........ [100%] 215s 215s ================ 1639 passed, 54 skipped, 15 xfailed in 44.27s ================= 215s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p "3.14 3.13" returned exit code 13 215s make: *** [/tmp/8PWZFYwQvB/run:4: pybuild-autopkgtest] Error 25 215s pybuild-autopkgtest: error: /tmp/8PWZFYwQvB/run pybuild-autopkgtest returned exit code 2 216s autopkgtest [13:04:48]: test pybuild-autopkgtest: -----------------------] 217s pybuild-autopkgtest FAIL non-zero exit status 25 217s autopkgtest [13:04:49]: test pybuild-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 217s autopkgtest [13:04:49]: @@@@@@@@@@@@@@@@@@@@ summary 217s pybuild-autopkgtest FAIL non-zero exit status 25